[webkit-reviews] review granted: [Bug 202394] ImageBitmap should be serializable : [Attachment 380211] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 4 06:24:49 PDT 2019


Zan Dobersek <zan at falconsigh.net> has granted Chris Lord <clord at igalia.com>'s
request for review:
Bug 202394: ImageBitmap should be serializable
https://bugs.webkit.org/show_bug.cgi?id=202394

Attachment 380211: Patch

https://bugs.webkit.org/attachment.cgi?id=380211&action=review




--- Comment #5 from Zan Dobersek <zan at falconsigh.net> ---
Comment on attachment 380211
  --> https://bugs.webkit.org/attachment.cgi?id=380211
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=380211&action=review

Patch looks good, just some additional checks required to cover the odd cases.

> Source/WebCore/bindings/js/SerializedScriptValue.cpp:923
> +	   auto imageData = buffer->getPremultipliedImageData(IntRect(0, 0,
logicalSize.width(), logicalSize.height()));

Looked it up only now -- getPremultipliedImageData() can possibly return null,
so we have to null-check around that as well.

> Source/WebCore/bindings/js/SerializedScriptValue.cpp:2776
> +	   auto imageData = Uint8ClampedArray::tryCreate(WTFMove(arrayBuffer),
0, arrayBuffer->byteLength());

tryCreate() possibly returns null, so we have to null-check it.

> Source/WebCore/bindings/js/SerializedScriptValue.cpp:2777
> +	   auto buffer = ImageBuffer::create(FloatSize(logicalWidth,
logicalHeight), Unaccelerated, resolutionScale);

Similar here -- ImageBuffer::create() can return null if internally the
initialization doesn't succeed (e.g. memory allocation or some other step
fails).


More information about the webkit-reviews mailing list