summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-27 01:19:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-27 01:25:00 +0200
commite823e7367754dd23de16a141c06471735a488f0d (patch)
tree64ddd222e17f5c144d401324be5c99b0aeb1507c /libswscale
parentfe573d1a9b742652f44cdc15b24fdd401eefc5e7 (diff)
sws_getGaussianVec: check variance and quality
Found-by: Reimar Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 03e9463773..81da98d651 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;