sws_getGaussianVec: check variance and quality
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Oct 2012 23:19:53 +0000 (01:19 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Oct 2012 23:25:00 +0000 (01:25 +0200)
Found-by: Reimar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/utils.c

index 03e9463..81da98d 100644 (file)
@@ -1435,7 +1435,12 @@ SwsVector *sws_getGaussianVec(double variance, double quality)
     const int length = (int)(variance * quality + 0.5) | 1;
     int i;
     double middle  = (length - 1) * 0.5;
-    SwsVector *vec = sws_allocVec(length);
+    SwsVector *vec;
+
+    if(variance < 0 || quality < 0)
+        return NULL;
+
+    vec = sws_allocVec(length);
 
     if (!vec)
         return NULL;