[FFmpeg-cvslog] lavc/opusdec: Fix a memleak when reading invalid files.
Carl Eugen Hoyos
git at videolan.org
Sun Nov 22 01:50:56 CET 2015
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Nov 22 01:49:18 2015 +0100| [ced39dc5ed3ad40e7f970c95019721d58742088a] | committer: Carl Eugen Hoyos
lavc/opusdec: Fix a memleak when reading invalid files.
Reviewed-by: James Almer
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ced39dc5ed3ad40e7f970c95019721d58742088a
---
libavcodec/opusdec.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index 31871e9..95a2435 100644
--- a/libavcodec/opusdec.c
+++ b/libavcodec/opusdec.c
@@ -671,8 +671,11 @@ static av_cold int opus_decode_init(AVCodecContext *avctx)
/* find out the channel configuration */
ret = ff_opus_parse_extradata(avctx, c);
- if (ret < 0)
+ if (ret < 0) {
+ av_freep(&c->channel_maps);
+ av_freep(&c->fdsp);
return ret;
+ }
/* allocate and init each independent decoder */
c->streams = av_mallocz_array(c->nb_streams, sizeof(*c->streams));
More information about the ffmpeg-cvslog
mailing list