mesa: Use gl_vertex_array_object::Enabled for glGet.
[mesa.git] / src / mesa / main / pbo.c
index 0c16025320136b33680acba733a4e5301799f84f..cea55f2a0d29eb7fe55969bdf644b1323980a838 100644 (file)
@@ -31,6 +31,7 @@
 
 
 
+#include "errors.h"
 #include "glheader.h"
 #include "bufferobj.h"
 #include "glformats.h"
@@ -103,6 +104,12 @@ _mesa_validate_pbo_access(GLuint dimensions,
       /* no buffer! */
       return GL_FALSE;
 
+   /* If the size of the image is zero then no pixels are accessed so we
+    * don't need to check anything else.
+    */
+   if (width == 0 || height == 0 || depth == 0)
+      return GL_TRUE;
+
    /* get the offset to the first pixel we'll read/write */
    start = _mesa_image_offset(dimensions, pack, width, height,
                               format, type, 0, 0, 0);