Bug 1276096 - ANGLE should check for NONE readbuffer. - r=jrmuizel
authorJeff Gilbert <jdashg@gmail.com>
Thu, 26 May 2016 17:22:08 -0700
changeset 340826 8efba00e40e4899ab7ddd94d210f270b4f972739
parent 340825 5bd57a49cb1f4a9a07f9fe92be74ab0296f7f1b7
child 340827 a8497187882983a15f0327a602c5a614174a658b
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1276096
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1276096 - ANGLE should check for NONE readbuffer. - r=jrmuizel
gfx/angle/src/libANGLE/Framebuffer.cpp
--- a/gfx/angle/src/libANGLE/Framebuffer.cpp
+++ b/gfx/angle/src/libANGLE/Framebuffer.cpp
@@ -64,16 +64,19 @@ Framebuffer::Data::~Data()
 
 const std::string &Framebuffer::Data::getLabel()
 {
     return mLabel;
 }
 
 const FramebufferAttachment *Framebuffer::Data::getReadAttachment() const
 {
+    if (mReadBufferState == GL_NONE)
+        return nullptr;
+
     ASSERT(mReadBufferState == GL_BACK || (mReadBufferState >= GL_COLOR_ATTACHMENT0 && mReadBufferState <= GL_COLOR_ATTACHMENT15));
     size_t readIndex = (mReadBufferState == GL_BACK ? 0 : static_cast<size_t>(mReadBufferState - GL_COLOR_ATTACHMENT0));
     ASSERT(readIndex < mColorAttachments.size());
     return mColorAttachments[readIndex].isAttached() ? &mColorAttachments[readIndex] : nullptr;
 }
 
 const FramebufferAttachment *Framebuffer::Data::getFirstColorAttachment() const
 {