Bug 1307257: Check for getColorAttachment returning null before using it. r?mtseng
MozReview-Commit-ID: C1C4RCKhjfH
--- 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;