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

Nicolai Hähnle nhaehnle at gmail.com
Thu Jun 2 20:50:11 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, 2 insertions(+)

diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 6df3a39..f42ff20 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -170,6 +170,8 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb,
       image.u.buf.last_element = addr.last_element;
 
       cso_set_shader_images(cso, PIPE_SHADER_FRAGMENT, 0, 1, &image);
+
+      pipe_resource_reference(&image.resource, NULL);
    }
 
    /* Set up no-attachment framebuffer */
-- 
2.7.4



More information about the mesa-dev mailing list