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

avcodec: fix double free on error

(cherry picked from commit 9bf41d6aeb35a121ce9c96adb21852ca69eb106b)
parent c66a9f43
...@@ -361,6 +361,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block ) ...@@ -361,6 +361,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
if( p_block->i_buffer == 0 ) if( p_block->i_buffer == 0 )
{ /* Done with this buffer */ { /* Done with this buffer */
block_Release( p_block ); block_Release( p_block );
p_block = NULL;
*pp_block = NULL; *pp_block = NULL;
} }
...@@ -448,6 +449,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block ) ...@@ -448,6 +449,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
end: end:
*pp_block = NULL; *pp_block = NULL;
drop: drop:
if( p_block != NULL )
block_Release(p_block); block_Release(p_block);
return NULL; return NULL;
} }
......
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