summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorPhilipp Zabel <[email protected]>2017-06-30 10:39:53 +0200
committerLucas Stach <[email protected]>2017-07-04 11:05:40 +0200
commit7d7bcd65d6019dfb63f31138a426fe2a043016db (patch)
tree7133b16953b788d3a9bb9990d31ee92a170c300d /src/mesa
parent2c240a7205eed0fca4d7b6fda9a2c4b1c6f7995d (diff)
st/mesa: release EGLImage on EGLImageTarget* error
The smapi->get_egl_image() call in st_egl_image_get_surface() stores a reference to the EGLImage's texture in stimg.texture. That reference is released via pipe_resource_reference(&stimg.texture, NULL) before stimg goes out of scope at the end of the function, but not in the error path if !is_format_supported(). Fixes: 83e9de25f325 ("st/mesa: EGLImageTarget* error handling") Cc: [email protected] Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_cb_eglimage.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c
index 0f649f4ab43..4b7b85db708 100644
--- a/src/mesa/state_tracker/st_cb_eglimage.c
+++ b/src/mesa/state_tracker/st_cb_eglimage.c
@@ -96,6 +96,7 @@ st_egl_image_get_surface(struct gl_context *ctx, GLeglImageOES image_handle,
if (!is_format_supported(screen, stimg.format, stimg.texture->nr_samples, usage)) {
/* unable to specify a texture object using the specified EGL image */
+ pipe_resource_reference(&stimg.texture, NULL);
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(format not supported)", error);
return NULL;
}