Bug 1307257: Check for getColorAttachment returning null before using it. r?mtseng draft
authorMilan Sreckovic <milan@mozilla.com>
Mon, 03 Oct 2016 17:36:27 -0400
changeset 420265 41875b94d5ce84d869adb1f56dff50a58993a0f0
parent 420017 955840bfd3c20eb24dd5a01be27bdc55c489a285
child 532771 dcecdf9966ab3b36b13d10e066b158b6a92273e5
push id31153
push usermsreckovic@mozilla.com
push dateMon, 03 Oct 2016 21:36:53 +0000
reviewersmtseng
bugs1307257
milestone52.0a1
Bug 1307257: Check for getColorAttachment returning null before using it. r?mtseng MozReview-Commit-ID: C1C4RCKhjfH
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
--- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
+++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
@@ -177,17 +177,20 @@ gl::Error Framebuffer11::invalidateBase(
             {
                 // Handle color attachments
                 ASSERT((attachments[i] >= GL_COLOR_ATTACHMENT0 && attachments[i] <= GL_COLOR_ATTACHMENT15) ||
                        (attachments[i] == GL_COLOR));
 
                 size_t colorIndex =
                     (attachments[i] == GL_COLOR ? 0u : (attachments[i] - GL_COLOR_ATTACHMENT0));
                 auto colorAttachment = mState.getColorAttachment(colorIndex);
-                ANGLE_TRY(invalidateAttachment(colorAttachment));
+		if (colorAttachment)
+		{
+		    ANGLE_TRY(invalidateAttachment(colorAttachment));
+		}
                 break;
             }
         }
     }
 
     bool discardDepth = false;
     bool discardStencil = false;