Browse code

swr: check count argument of realloc_audio()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/05/23 00:15:07
Showing 1 changed files
... ...
@@ -344,6 +344,9 @@ static int realloc_audio(AudioData *a, int count){
344 344
     int i, countb;
345 345
     AudioData old;
346 346
 
347
+    if(count < 0 || count > INT_MAX/2/a->bps/a->ch_count)
348
+        return AVERROR(EINVAL);
349
+
347 350
     if(a->count >= count)
348 351
         return 0;
349 352