From 5976d2e45466f53b80717ef2b750af03cf179e79 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Fri, 15 Jun 2012 17:36:48 -0400 Subject: [PATCH] Bug 765198 - WebGL crash in readPixels with null destination - r=bz --- content/canvas/src/WebGLContextGL.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/canvas/src/WebGLContextGL.cpp b/content/canvas/src/WebGLContextGL.cpp index 20d2b7ac24e..8cc45c1530d 100644 --- a/content/canvas/src/WebGLContextGL.cpp +++ b/content/canvas/src/WebGLContextGL.cpp @@ -3849,6 +3849,9 @@ WebGLContext::ReadPixels(WebGLint x, WebGLint y, WebGLsizei width, if (width < 0 || height < 0) return ErrorInvalidValue("readPixels: negative size passed"); + if (!pixels) + return ErrorInvalidValue("readPixels: null destination buffer"); + const WebGLRectangleObject *framebufferRect = FramebufferRectangleObject(); WebGLsizei framebufferWidth = framebufferRect ? framebufferRect->Width() : 0; WebGLsizei framebufferHeight = framebufferRect ? framebufferRect->Height() : 0;