diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-27 01:19:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-27 01:25:00 +0200 |
commit | e823e7367754dd23de16a141c06471735a488f0d (patch) | |
tree | 64ddd222e17f5c144d401324be5c99b0aeb1507c /libswscale/utils.c | |
parent | fe573d1a9b742652f44cdc15b24fdd401eefc5e7 (diff) | |
download | ffmpeg-e823e7367754dd23de16a141c06471735a488f0d.tar.gz |
sws_getGaussianVec: check variance and quality
Found-by: Reimar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r-- | libswscale/utils.c | 7 |
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; |