Bug 1289653 - Disallow null `pixels` in texSubImage. - r=mtseng
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 26 Jul 2016 19:49:33 -0700
changeset 332256 eec926b50ce373c640223e109d1c921c88ca50ae
parent 332255 d9762a7de374a5d59dfb9119311191dace721f5c
child 332257 baa51ac42cd7d353d2fba2722230bb48d8e2c3d7
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmtseng
bugs1289653
milestone50.0a1
Bug 1289653 - Disallow null `pixels` in texSubImage. - r=mtseng MozReview-Commit-ID: HgbJEhykEda
dom/canvas/WebGLTextureUpload.cpp
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -257,16 +257,19 @@ WebGLTexture::TexOrSubImage(bool isSubIm
         }
 
         if (width && height && depth) {
             view.ComputeLengthAndData();
 
             bytes = view.DataAllowShared();
             byteCount = view.LengthAllowShared();
         }
+    } else if (isSubImage) {
+        mContext->ErrorInvalidValue("%s: `pixels` must not be null.", funcName);
+        return;
     }
 
     const bool isClientData = true;
     webgl::TexUnpackBytes blob(mContext, target, width, height, depth, isClientData,
                                bytes);
 
     if (bytes &&
         !ValidateUnpackBytes(mContext, funcName, width, height, depth, pi, byteCount,