[Mesa-dev] [PATCH v2] st/mesa: fix resource leak in try_pbo_readpixels

Nicolai Hähnle nhaehnle at gmail.com
Fri Jun 3 12:13:50 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Found by inspection after seeing
https://bugs.freedesktop.org/show_bug.cgi?id=96343
---
 src/mesa/state_tracker/st_cb_readpixels.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 6df3a39..599cb9e 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -163,7 +163,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;
-- 
2.7.4



More information about the mesa-dev mailing list