aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-01-21 02:38:05 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-21 02:39:09 +0100
commit19e456d48c90a1e3ceeb9e6241383384cc73dfdf (patch)
tree0dc56b9deadb0a40896fee4a71209fa8fca68d41
parenta53fbda9dc92273054a103db7539d2bb6e9632b2 (diff)
downloadffmpeg-19e456d48c90a1e3ceeb9e6241383384cc73dfdf.tar.gz
avcodec/wmaenc: Check ff_wma_init() for failure
Fixes null pointer dereference Fixes: c4faf8280ba366bf00a79d425f2910a8/signal_sigsegv_1f96477_5177_1448ba7e4125faceb966f44ceb69abfa.qcp Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wmaenc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index abe8e4b876..d0727e69b2 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -33,6 +33,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
WMACodecContext *s = avctx->priv_data;
int i, flags1, flags2, block_align;
uint8_t *extradata;
+ int ret;
s->avctx = avctx;
@@ -83,7 +84,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
if (avctx->channels == 2)
s->ms_stereo = 1;
- ff_wma_init(avctx, flags2);
+ if ((ret = ff_wma_init(avctx, flags2)) < 0)
+ return ret;
/* init MDCT */
for (i = 0; i < s->nb_block_sizes; i++)