[Mesa-dev] [PATCH] mesa: prevent SIGSEGV passing GL_NONE to _mesa_ReadBuffer()

Ahmed Allam ahmabdabd at hotmail.com
Thu Jan 23 06:31:12 PST 2014


From: Ahmed Allam <ahmabdabd at hotmail.com>


Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73956

Signed-off-by: Ahmed Allam <ahmabdabd at hotmail.com>
---
  src/mesa/main/buffers.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 2bdbf41..6c846cb 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -623,7 +623,9 @@ _mesa_ReadBuffer(GLenum buffer)

     if (buffer == GL_NONE) {
        /* This is legal--it means that no buffer should be bound for 
reading. */
-      srcBuffer = -1;
+      _mesa_error(ctx, GL_INVALID_ENUM,
+                           "glReadBuffer(buffer=0x%x)", buffer);
+     return;
     }
     else {
        /* general case / window-system framebuffer */
-- 
1.8.5.3



More information about the mesa-dev mailing list