Mesa (7.11): mesa: fix format/type check in unpack_image() for bitmaps

Ian Romanick idr at kemper.freedesktop.org
Tue Oct 25 18:42:16 PDT 2011


Module: Mesa
Branch: 7.11
Commit: e4f88bcad32321f3df529985db943096c6d034c2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e4f88bcad32321f3df529985db943096c6d034c2

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Sep 19 11:38:02 2011 -0600

mesa: fix format/type check in unpack_image() for bitmaps

Passing type == GL_BITMAP returns 0 while error values return -1.
This fixes glPolygonStipple being compiled into display lists.
(cherry picked from commit 2ce8c3553b5f7b97b110ff7d968411027c156552)

---

 src/mesa/main/dlist.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 476ecc4..eb314be 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -891,7 +891,7 @@ unpack_image(struct gl_context *ctx, GLuint dimensions,
       return NULL;
    }
 
-   if (_mesa_bytes_per_pixel(format, type) <= 0) {
+   if (_mesa_bytes_per_pixel(format, type) < 0) {
       /* bad format and/or type */
       return NULL;
    }



More information about the mesa-commit mailing list