[FFmpeg-cvslog] sws_getGaussianVec: check variance and quality

Michael Niedermayer git at videolan.org
Sat Oct 27 01:34:06 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 27 01:19:53 2012 +0200| [e823e7367754dd23de16a141c06471735a488f0d] | committer: Michael Niedermayer

sws_getGaussianVec: check variance and quality

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e823e7367754dd23de16a141c06471735a488f0d
---

 libswscale/utils.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 03e9463..81da98d 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -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;



More information about the ffmpeg-cvslog mailing list