mesa: fix format/type check in unpack_image() for bitmaps
authorBrian Paul <brianp@vmware.com>
Mon, 19 Sep 2011 17:38:02 +0000 (11:38 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 19 Sep 2011 17:39:30 +0000 (11:39 -0600)
Passing type == GL_BITMAP returns 0 while error values return -1.
This fixes glPolygonStipple being compiled into display lists.

src/mesa/main/dlist.c

index 2b2ff9015cbd722f4b308daed4e46f2bce8c35cc..e8f8fe2ae659a5d73fc12b71762db048c96f8f2a 100644 (file)
@@ -887,7 +887,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;
    }