Bug 1151930 - Check against updated length while appending. r=kamidphish, a=lizzard
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 08 Apr 2015 18:55:16 -0700
changeset 265604 3cea876963c4724d09e5a88dcfffe62a94e11e1b
parent 265603 52679d3b56c56da1e43577489707cc7fadeb5a15
child 265605 869f5b771a28e410eabcae89fdcbdde145adcc04
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskamidphish, lizzard
bugs1151930
milestone39.0a2
Bug 1151930 - Check against updated length while appending. r=kamidphish, a=lizzard
dom/canvas/WebGLFramebuffer.cpp
--- a/dom/canvas/WebGLFramebuffer.cpp
+++ b/dom/canvas/WebGLFramebuffer.cpp
@@ -824,23 +824,22 @@ WebGLFramebuffer::CheckAndInitializeAtta
 
 void WebGLFramebuffer::EnsureColorAttachPoints(size_t colorAttachmentId)
 {
     MOZ_ASSERT(colorAttachmentId < WebGLContext::kMaxColorAttachments);
 
     if (colorAttachmentId < ColorAttachmentCount())
         return;
 
-    size_t colorAttachmentCount = ColorAttachmentCount();
-    while (colorAttachmentCount < WebGLContext::kMaxColorAttachments) {
-        GLenum nextAttachPoint = LOCAL_GL_COLOR_ATTACHMENT0 + colorAttachmentCount;
+    while (ColorAttachmentCount() < WebGLContext::kMaxColorAttachments) {
+        GLenum nextAttachPoint = LOCAL_GL_COLOR_ATTACHMENT0 + ColorAttachmentCount();
         mMoreColorAttachments.AppendElement(AttachPoint(this, nextAttachPoint));
     }
 
-    MOZ_ASSERT(colorAttachmentCount == ColorAttachmentCount());
+    MOZ_ASSERT(ColorAttachmentCount() == WebGLContext::kMaxColorAttachments);
 }
 
 static void
 FinalizeDrawAndReadBuffers(gl::GLContext* gl, bool isColorBufferDefined)
 {
     MOZ_ASSERT(gl, "Expected a valid GLContext ptr.");
     // GLES don't support DrawBuffer()/ReadBuffer.
     // According to http://www.opengl.org/wiki/Framebuffer_Object