aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2015-11-22 01:49:18 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2015-11-22 01:49:18 +0100
commitced39dc5ed3ad40e7f970c95019721d58742088a (patch)
tree68c680dc2bea8acd18cbc2bf8c61e5da899dfa37 /libavcodec
parentf5074dd39ca3bc6bff96cafea1d723cf944f50e5 (diff)
downloadffmpeg-ced39dc5ed3ad40e7f970c95019721d58742088a.tar.gz
lavc/opusdec: Fix a memleak when reading invalid files.
Reviewed-by: James Almer
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/opusdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index 31871e9994..95a2435e53 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));