From e823e7367754dd23de16a141c06471735a488f0d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 27 Oct 2012 01:19:53 +0200 Subject: sws_getGaussianVec: check variance and quality Found-by: Reimar Signed-off-by: Michael Niedermayer --- libswscale/utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libswscale') 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; -- cgit v1.2.3