st/va: do not destroy old buffer when new one failed
authorJulien Isorce <j.isorce@samsung.com>
Fri, 30 Oct 2015 11:42:45 +0000 (11:42 +0000)
committerChristian König <christian.koenig@amd.com>
Fri, 30 Oct 2015 12:19:47 +0000 (13:19 +0100)
commitd42029d2d9bc6b65ccf847dc9ba2e70b496d0299
tree7b7ba19e345dda95e81472fb67722fa675add9be
parent87109e5f88131b78232e42c8fe246002867fb247
st/va: do not destroy old buffer when new one failed

If formats are not the same vlVaPutImage re-creates the video
buffer with the right format. But if the creation of this new
video buffer fails then the surface looses its current buffer.
Let's just destroy the previous buffer on success.

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/va/image.c