aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-16 03:31:25 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-21 21:59:17 +0100
commit037b1142cde54e64c8de2a5fd79c259a36b5e244 (patch)
tree15202aff9f71e88ab257e1997344b33f8bd35ede
parent37cc48861d7898c27d4b95cf890e01ba44ddae02 (diff)
downloadffmpeg-037b1142cde54e64c8de2a5fd79c259a36b5e244.tar.gz
wma: Check channel number before init.
Fixes Ticket240 Based on patch by ami_stuff Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 20431a9982b9bd2c475042d919890a941ad70c71) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/wmadec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index e7936ce49f..088d510a0b 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -105,6 +105,11 @@ static int wma_decode_init(AVCodecContext * avctx)
s->use_bit_reservoir = flags2 & 0x0002;
s->use_variable_block_len = flags2 & 0x0004;
+ if(avctx->channels > MAX_CHANNELS){
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of channels (%d)\n", avctx->channels);
+ return -1;
+ }
+
if(ff_wma_init(avctx, flags2)<0)
return -1;