js: image data: Avoid int overflow before size_t conversion

This commit is contained in:
Michael Drake 2022-10-22 21:30:13 +01:00 committed by Michael Drake
parent c50f4bab09
commit cb5d63768c

View File

@ -39,6 +39,6 @@ getter ImageData::data()
%{
duk_push_this(ctx);
duk_get_prop_string(ctx, -1, MAGIC(DATA));
duk_push_buffer_object(ctx, -1, 0, priv->width * priv->height * 4, DUK_BUFOBJ_UINT8CLAMPEDARRAY);
duk_push_buffer_object(ctx, -1, 0, priv->width * priv->height * 4llu, DUK_BUFOBJ_UINT8CLAMPEDARRAY);
return 1;
%}