summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/swrast/s_readpix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 9e80908ba1..6171b3440e 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -507,6 +507,9 @@ _swrast_ReadPixels( GLcontext *ctx,
/* Do all needed clipping here, so that we can forget about it later */
clippedPacking = *packing;
+ if (clippedPacking.RowLength == 0) {
+ clippedPacking.RowLength = width;
+ }
if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height,
&clippedPacking.SkipPixels,
&clippedPacking.SkipRows)) {