[vlc-commits] avcodec: fix double free on error
Rémi Denis-Courmont
git at videolan.org
Thu Oct 16 19:23:23 CEST 2014
vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 16 20:20:12 2014 +0300| [b3f316e8b18d4c303de7bd27d2397bf0f5fd173a] | committer: Rémi Denis-Courmont
avcodec: fix double free on error
(cherry picked from commit 9bf41d6aeb35a121ce9c96adb21852ca69eb106b)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=b3f316e8b18d4c303de7bd27d2397bf0f5fd173a
---
modules/codec/avcodec/audio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index 254c06d..34c8352 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -361,6 +361,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
if( p_block->i_buffer == 0 )
{ /* Done with this buffer */
block_Release( p_block );
+ p_block = NULL;
*pp_block = NULL;
}
@@ -448,7 +449,8 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
end:
*pp_block = NULL;
drop:
- block_Release(p_block);
+ if( p_block != NULL )
+ block_Release(p_block);
return NULL;
}
More information about the vlc-commits
mailing list