swr: check count argument of realloc_audio()
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 22 May 2012 15:15:07 +0000 (17:15 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 22 May 2012 18:37:12 +0000 (20:37 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/swresample.c

index 60706d3..732dae7 100644 (file)
@@ -344,6 +344,9 @@ static int realloc_audio(AudioData *a, int count){
     int i, countb;
     AudioData old;
 
+    if(count < 0 || count > INT_MAX/2/a->bps/a->ch_count)
+        return AVERROR(EINVAL);
+
     if(a->count >= count)
         return 0;