fix clipped glReadPixels bug
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 23 Sep 2005 02:16:49 +0000 (02:16 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 23 Sep 2005 02:16:49 +0000 (02:16 +0000)
src/mesa/swrast/s_readpix.c

index 9e80908..6171b34 100644 (file)
@@ -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)) {