summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_readpix.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-12-18 14:51:42 -0800
committerEric Anholt <eric@anholt.net>2007-12-18 14:51:42 -0800
commit9efa1029e5a2ee90e3265d9959730685ce841b66 (patch)
treee68469effaa5dfcd8f8029eee02d800cfa19c277 /src/mesa/swrast/s_readpix.c
parent4878f12189c52e1cafe9240183d0e371a1f287d3 (diff)
Fix mismatched map/unmap of buffers in swrast read/drawpixels error paths.
Diffstat (limited to 'src/mesa/swrast/s_readpix.c')
-rw-r--r--src/mesa/swrast/s_readpix.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 916ddc1b97..8df15c8704 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -570,7 +570,8 @@ _swrast_ReadPixels( GLcontext *ctx,
/* Do all needed clipping here, so that we can forget about it later */
if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
/* The ReadPixels region is totally outside the window bounds */
- goto end;
+ RENDER_FINISH(swrast, ctx);
+ return;
}
if (clippedPacking.BufferObj->Name) {
@@ -580,7 +581,8 @@ _swrast_ReadPixels( GLcontext *ctx,
format, type, pixels)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glReadPixels(invalid PBO access)");
- goto end;
+ RENDER_FINISH(swrast, ctx);
+ return;
}
buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT,
GL_WRITE_ONLY_ARB,
@@ -588,7 +590,8 @@ _swrast_ReadPixels( GLcontext *ctx,
if (!buf) {
/* buffer is already mapped - that's an error */
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(PBO is mapped)");
- goto end;
+ RENDER_FINISH(swrast, ctx);
+ return;
}
pixels = ADD_POINTERS(buf, pixels);
}
@@ -629,8 +632,6 @@ _swrast_ReadPixels( GLcontext *ctx,
/* don't return yet, clean-up */
}
-
-end:
RENDER_FINISH(swrast, ctx);
if (clippedPacking.BufferObj->Name) {