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 9e80908ba1f40dc86f1d5f2ab7a185e19ba7c566..6171b3440e6e3118a18bc34d6ff29b9c03361974 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)) {