summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2015-09-01 15:13:45 +1000
committerEmil Velikov <[email protected]>2015-09-06 18:53:38 +0100
commitbb378249594f860b97d91d51956c019b2d111a05 (patch)
treef27131d0de901c9caa1c9dd35cf85c66d2aa88c9
parent8fc2cbb00e08986b5962e6cbb13c3155a17b9f05 (diff)
st/readpixels: fix accel path for skipimages.
We don't need to use the 3d image address here as that will include SKIP_IMAGES, and we are only blitting a single 2D anyways, so just use the 2D path. This fixes some memory overruns under CTS packed_pixels.packed_pixels_pixelstore when PACK_SKIP_IMAGES is used. Cc: "11.0" <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]> (cherry picked from commit 6a3e1fb958778e00e8fe2d860b6327fc4409c148)
-rw-r--r--src/mesa/state_tracker/st_cb_readpixels.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 18ea43fa71a..cc9b105b9ed 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -238,9 +238,9 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y,
GLuint row;
for (row = 0; row < (unsigned) height; row++) {
- GLvoid *dest = _mesa_image_address3d(pack, pixels,
+ GLvoid *dest = _mesa_image_address2d(pack, pixels,
width, height, format,
- type, 0, row, 0);
+ type, row, 0);
memcpy(dest, map, bytesPerRow);
map += tex_xfer->stride;
}