st/mesa: release EGLImage on EGLImageTarget* error
authorPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 30 Jun 2017 08:39:53 +0000 (10:39 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Tue, 4 Jul 2017 09:05:40 +0000 (11:05 +0200)
commit7d7bcd65d6019dfb63f31138a426fe2a043016db
tree7133b16953b788d3a9bb9990d31ee92a170c300d
parent2c240a7205eed0fca4d7b6fda9a2c4b1c6f7995d
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: mesa-stable@lists.freedesktop.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_cb_eglimage.c