Bug 765198 - WebGL crash in readPixels with null destination - r=bz

This commit is contained in:
Benoit Jacob 2012-06-15 17:36:48 -04:00
parent 03af05e76c
commit 5976d2e454

View File

@ -3849,6 +3849,9 @@ WebGLContext::ReadPixels(WebGLint x, WebGLint y, WebGLsizei width,
if (width < 0 || height < 0) if (width < 0 || height < 0)
return ErrorInvalidValue("readPixels: negative size passed"); return ErrorInvalidValue("readPixels: negative size passed");
if (!pixels)
return ErrorInvalidValue("readPixels: null destination buffer");
const WebGLRectangleObject *framebufferRect = FramebufferRectangleObject(); const WebGLRectangleObject *framebufferRect = FramebufferRectangleObject();
WebGLsizei framebufferWidth = framebufferRect ? framebufferRect->Width() : 0; WebGLsizei framebufferWidth = framebufferRect ? framebufferRect->Width() : 0;
WebGLsizei framebufferHeight = framebufferRect ? framebufferRect->Height() : 0; WebGLsizei framebufferHeight = framebufferRect ? framebufferRect->Height() : 0;