Commit f04dfb86 authored by Jean-Paul Saman's avatar Jean-Paul Saman

codec/avcodec/vaapi*: fix potential subpictures memleak

parent 309ce1a0
......@@ -403,6 +403,9 @@ static vlc_va_surface_t *FindSurface( vlc_va_t *p_external, const VASurfaceID i_
*/
p_tmp->i_refcount++;
p_surface = p_tmp;
free(p_surface->subpicture);
p_surface->subpicture = NULL;
p_surface->i_sub = 0;
vlc_mutex_unlock(&p_tmp->lock);
break;
}
......
......@@ -580,6 +580,8 @@ static int RenderDirectSubpicture(vout_display_t *vd, picture_t *picture, subpic
{
vout_display_sys_t *sys = vd->sys;
assert(picture->p_sys->surface->subpicture == NULL);
vlc_va_subpicture_t *vasubpic = (vlc_va_subpicture_t*) calloc(i_region, sizeof(vlc_va_subpicture_t));
if (!vasubpic)
return VLC_EGENERIC;
......
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