From: Erik Faye-Lund Date: Thu, 28 Nov 2019 16:51:20 +0000 (+0100) Subject: st/mesa: unmap pbo after updating cache X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c7c0bd9f1ec41a0097987e5af1ecc935a880b9fe;p=mesa.git st/mesa: unmap pbo after updating cache Unmapping first leads to accessing an invalid pointer. So let's switch these lines around. Reviewed-by: Marek Olšák --- diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index fc11bc3ae47..a220c841597 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -722,12 +722,12 @@ make_texture(struct st_context *st, ctx->_ImageTransferState = imageTransferStateSave; } - _mesa_unmap_pbo_source(ctx, unpack); - #if USE_DRAWPIXELS_CACHE cache_drawpixels_image(st, width, height, format, type, unpack, pixels, pt); #endif + _mesa_unmap_pbo_source(ctx, unpack); + return pt; }