Bug 802778 - validate level parameter in copyTexImage2D - r=jgilbert
authorBenoit Jacob <bjacob@mozilla.com>
Fri, 09 Nov 2012 16:48:54 -0500
changeset 112882 8f0f5a7da4bc17669dce4148a69e1777d1205a54
parent 112881 df73d3bca6e006051a08d15dd84347c59b288fb1
child 112883 28469cfc8eecaa9e3b5d19970a408012ff49fd53
push id17814
push userbjacob@mozilla.com
push dateFri, 09 Nov 2012 21:49:38 +0000
treeherdermozilla-inbound@8f0f5a7da4bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs802778
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 802778 - validate level parameter in copyTexImage2D - r=jgilbert
content/canvas/src/WebGLContextGL.cpp
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -666,16 +666,20 @@ WebGLContext::CopyTexSubImage2D_base(Web
                                      bool sub)
 {
     const WebGLRectangleObject *framebufferRect = FramebufferRectangleObject();
     WebGLsizei framebufferWidth = framebufferRect ? framebufferRect->Width() : 0;
     WebGLsizei framebufferHeight = framebufferRect ? framebufferRect->Height() : 0;
 
     const char *info = sub ? "copyTexSubImage2D" : "copyTexImage2D";
 
+    if (!ValidateLevelWidthHeightForTarget(target, level, width, height, info)) {
+        return;
+    }
+
     MakeContextCurrent();
 
     WebGLTexture *tex = activeBoundTextureForTarget(target);
 
     if (!tex)
         return ErrorInvalidOperation("%s: no texture is bound to this target");
 
     if (CanvasUtils::CheckSaneSubrectSize(x, y, width, height, framebufferWidth, framebufferHeight)) {