Commit 3fc28a0b authored by Thomas Guillem's avatar Thomas Guillem

avcodec: fix invalid free

Initialize frame to NULL before goto end
parent 84c306e2
...@@ -244,6 +244,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block ) ...@@ -244,6 +244,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
{ {
decoder_sys_t *p_sys = p_dec->p_sys; decoder_sys_t *p_sys = p_dec->p_sys;
AVCodecContext *ctx = p_sys->p_context; AVCodecContext *ctx = p_sys->p_context;
AVFrame *frame = NULL;
if( !pp_block || !*pp_block ) if( !pp_block || !*pp_block )
return NULL; return NULL;
...@@ -290,7 +291,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block ) ...@@ -290,7 +291,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
p_block->i_flags |= BLOCK_FLAG_PRIVATE_REALLOCATED; p_block->i_flags |= BLOCK_FLAG_PRIVATE_REALLOCATED;
} }
AVFrame *frame = av_frame_alloc(); frame = av_frame_alloc();
if (unlikely(frame == NULL)) if (unlikely(frame == NULL))
goto end; goto end;
......
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