From: Nicolai Hähnle Date: Thu, 2 Jun 2016 20:48:52 +0000 (+0200) Subject: st/mesa: fix resource leak in try_pbo_readpixels X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0f916d4ca741ff544fa2da72c3b11c5ca64b8b74;p=mesa.git st/mesa: fix resource leak in try_pbo_readpixels Found by inspection after seeing https://bugs.freedesktop.org/show_bug.cgi?id=96343 Reviewed-by: Marek Olšák --- diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 09450c9f41b..42ff73b0691 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -169,7 +169,7 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb, struct pipe_image_view image; memset(&image, 0, sizeof(image)); - pipe_resource_reference(&image.resource, addr.buffer); + image.resource = addr.buffer; image.format = dst_format; image.access = PIPE_IMAGE_ACCESS_WRITE; image.u.buf.first_element = addr.first_element;