mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 730554 - Part b: Check the result of JS_GetProperty in TexImage2DImageDataOrElement; r=bz
This commit is contained in:
parent
11fb7b5ca6
commit
9814185b9a
@ -3,4 +3,5 @@ load 421715-1.html
|
||||
load 553938-1.html
|
||||
load 647480.html
|
||||
load 0px-size-font-667225.html
|
||||
load texImage2D.html
|
||||
load 729116.html
|
||||
|
8
content/canvas/crashtests/texImage2D.html
Normal file
8
content/canvas/crashtests/texImage2D.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!doctype html>
|
||||
<canvas></canvas>
|
||||
<script>
|
||||
var canvas = document.body.firstChild,
|
||||
gl = canvas.getContext("experimental-webgl");
|
||||
gl.texImage2D(0, 0, 0, 0, 0, { get width() { throw 7 }, get height() { throw 7 }, data: new Uint8ClampedArray(10) });
|
||||
gl.texSubImage2D(0, 0, 0, 0, 0, 0, { get width() { throw 7 }, get height() { throw 7 }, data: new Uint8ClampedArray(10) });
|
||||
</script>
|
@ -494,9 +494,11 @@ TexImage2DImageDataOrElement(JSContext* cx, T& self, JS::Value* object)
|
||||
JSObject* imageData = &object->toObject();
|
||||
|
||||
jsval js_width, js_height, js_data;
|
||||
JS_GetProperty(cx, imageData, "width", &js_width);
|
||||
JS_GetProperty(cx, imageData, "height", &js_height);
|
||||
JS_GetProperty(cx, imageData, "data", &js_data);
|
||||
if (!JS_GetProperty(cx, imageData, "width", &js_width) ||
|
||||
!JS_GetProperty(cx, imageData, "height", &js_height) ||
|
||||
!JS_GetProperty(cx, imageData, "data", &js_data)) {
|
||||
return false;
|
||||
}
|
||||
if (js_width == JSVAL_VOID ||
|
||||
js_height == JSVAL_VOID ||
|
||||
!js_data.isObject())
|
||||
|
Loading…
Reference in New Issue
Block a user