Commit 36a00fd7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

picture: add assertion against double free

parent 70055757
......@@ -266,8 +266,12 @@ picture_t *picture_Hold( picture_t *p_picture )
void picture_Release( picture_t *p_picture )
{
if( vlc_atomic_dec( &p_picture->gc.refcount ) == 0 &&
p_picture->gc.pf_destroy )
uintptr_t refs = vlc_atomic_dec( &p_picture->gc.refcount );
assert( refs != (uintptr_t)-1 );
if( refs > 0 )
return;
if( p_picture->gc.pf_destroy != NULL )
p_picture->gc.pf_destroy( p_picture );
}
......
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