Commit 40e38ac0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vdpau: fix leak on picture pool error

(same problem as XCB)
parent bf697698
...@@ -136,7 +136,15 @@ static picture_pool_t *PoolAlloc(vout_display_t *vd, unsigned requested_count) ...@@ -136,7 +136,15 @@ static picture_pool_t *PoolAlloc(vout_display_t *vd, unsigned requested_count)
count++; count++;
} }
sys->current = NULL; sys->current = NULL;
return count ? picture_pool_New(count, pics) : NULL;
if (count == 0)
return NULL;
picture_pool_t *pool = picture_pool_New(count, pics);
if (unlikely(pool == NULL))
while (count > 0)
picture_Release(pics[--count]);
return pool;
} }
static void PoolFree(vout_display_t *vd, picture_pool_t *pool) static void PoolFree(vout_display_t *vd, picture_pool_t *pool)
......
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