Bug 569431 - Optimization in DrawElements - followup: fix warning - r=vlad, a=blocking2.0
authorBenoit Jacob <bjacob@mozilla.com>
Sat, 29 Jan 2011 22:31:20 -0500
changeset 61597 0ab93abd23cb40f5918e16b0e1b5b7706fd18a2e
parent 61596 3ea2b5a7c9c8eaa346875fe644c444df5f388d38
child 61598 268957af2047b4565587b46f052669b18b9079fd
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersvlad, blocking2
bugs569431
milestone2.0b11pre
Bug 569431 - Optimization in DrawElements - followup: fix warning - r=vlad, a=blocking2.0
content/canvas/src/WebGLContextValidate.cpp
--- a/content/canvas/src/WebGLContextValidate.cpp
+++ b/content/canvas/src/WebGLContextValidate.cpp
@@ -117,32 +117,32 @@ WebGLContext::ValidateBuffers(PRInt32 *m
         }
 
         // If the attrib is not in use, then we don't have to validate
         // it, just need to make sure that the binding is non-null.
         if (!mCurrentProgram->IsAttribInUse(i))
             continue;
 
         // the base offset
-        CheckedUint32 checked_byteLength
-          = CheckedUint32(vd.buf->ByteLength()) - vd.byteOffset;
-        CheckedUint32 checked_sizeOfLastElement
-          = CheckedUint32(vd.componentSize()) * vd.size;
+        CheckedInt32 checked_byteLength
+          = CheckedInt32(vd.buf->ByteLength()) - vd.byteOffset;
+        CheckedInt32 checked_sizeOfLastElement
+          = CheckedInt32(vd.componentSize()) * vd.size;
 
         if (!checked_byteLength.valid() ||
             !checked_sizeOfLastElement.valid())
         {
           ErrorInvalidOperation("%s: integer overflow occured while checking vertex attrib %d", info, i);
           return PR_FALSE;
         }
 
         if (checked_byteLength.value() < checked_sizeOfLastElement.value()) {
           *maxAllowedCount = 0;
         } else {
-          CheckedUint32 checked_maxAllowedCount
+          CheckedInt32 checked_maxAllowedCount
             = ((checked_byteLength - checked_sizeOfLastElement) / vd.actualStride()) + 1;
 
           if (!checked_maxAllowedCount.valid()) {
             ErrorInvalidOperation("%s: integer overflow occured while checking vertex attrib %d", info, i);
             return PR_FALSE;
           }
 
           if (*maxAllowedCount == -1 || *maxAllowedCount > checked_maxAllowedCount.value())