Commit c63107f4 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Avoid potential integer overflow in ImageBitmap failure check.

Change-Id: I661ebde62fbe9b010d923a4948ecb942a214cb17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1862625
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarAndreas Haas <ahaas@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706028}
parent 43f9cd8f
...@@ -306,7 +306,7 @@ bool V8ScriptValueSerializer::WriteDOMObject(ScriptWrappable* wrappable, ...@@ -306,7 +306,7 @@ bool V8ScriptValueSerializer::WriteDOMObject(ScriptWrappable* wrappable,
WriteUint32(image_bitmap->height()); WriteUint32(image_bitmap->height());
Vector<uint8_t> pixels = image_bitmap->CopyBitmapData(); Vector<uint8_t> pixels = image_bitmap->CopyBitmapData();
// Check if we succeeded to copy the BitmapData. // Check if we succeeded to copy the BitmapData.
if (image_bitmap->width() * image_bitmap->height() != 0 && if (image_bitmap->width() != 0 && image_bitmap->height() != 0 &&
pixels.size() == 0) { pixels.size() == 0) {
exception_state.ThrowDOMException( exception_state.ThrowDOMException(
DOMExceptionCode::kDataCloneError, DOMExceptionCode::kDataCloneError,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment