Commit 7e7983e5 authored by Jean-Paul Saman's avatar Jean-Paul Saman

VAAPI-X11: call cache_SubpictureRelease() only when there is a subpicture.

If creating a subpicture fails, then the picture is not going to carry a
reference to the cached subpicture structure. In this case the cached
subpicture was being freed anyway. Which resulted in a crash.

Instead check if there is an subpicture cache id and if it is > 0,
before attempting to release it.
parent 2239e768
......@@ -1345,7 +1345,8 @@ out:
SubpictureRegionsUnlink(vd, picture);
vlc_mutex_lock(&sys->cache_lock);
cache_SubpictureRelease(vd, picture->p_sys->i_cache);
if (picture->p_sys->i_cache > 0)
cache_SubpictureRelease(vd, picture->p_sys->i_cache);
picture->p_sys->i_cache = 0;
vlc_mutex_unlock(&sys->cache_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment