summaryrefslogtreecommitdiff
path: root/libavcodec/opus.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-12-09 00:00:18 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-12-10 13:36:12 +0100
commit7d3baebe408cb7377dbb6fa1a7fd285e8e366440 (patch)
treeddd2315d4417b33a6a3dd46316521f18267f98c2 /libavcodec/opus.c
parentdf694a5e9d40bdae734c8bb9523c13722b38ebe5 (diff)
opus_parser: fix leaking channel_maps on error
Make ff_opus_parse_extradata free allocated memory on error instead of expecting callers to free it in that case. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/opus.c')
-rw-r--r--libavcodec/opus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/opus.c b/libavcodec/opus.c
index 08d94b6cba..1eeb92c5bd 100644
--- a/libavcodec/opus.c
+++ b/libavcodec/opus.c
@@ -403,6 +403,7 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
} else if (idx >= streams + stereo_streams) {
av_log(avctx, AV_LOG_ERROR,
"Invalid channel map for output channel %d: %d\n", i, idx);
+ av_freep(&s->channel_maps);
return AVERROR_INVALIDDATA;
}