Browse code

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>

Michael Niedermayer authored on 2011/11/16 11:31:25
Showing 1 changed files
... ...
@@ -109,6 +109,11 @@ static int wma_decode_init(AVCodecContext * avctx)
109 109
         }
110 110
     }
111 111
 
112
+    if(avctx->channels > MAX_CHANNELS){
113
+        av_log(avctx, AV_LOG_ERROR, "Invalid number of channels (%d)\n", avctx->channels);
114
+        return -1;
115
+    }
116
+
112 117
     if(ff_wma_init(avctx, flags2)<0)
113 118
         return -1;
114 119