summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pbo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/pbo.c')
-rw-r--r--src/mesa/main/pbo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/pbo.c b/src/mesa/main/pbo.c
index 0c160253201..7762324a4ae 100644
--- a/src/mesa/main/pbo.c
+++ b/src/mesa/main/pbo.c
@@ -103,6 +103,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);