diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-27 01:18:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-27 01:24:51 +0200 |
commit | fe573d1a9b742652f44cdc15b24fdd401eefc5e7 (patch) | |
tree | bd217b7cb554c893699db36fb071ab515ea8f4f7 /libswscale/utils.c | |
parent | a9d97e1b0af676c82abbf2673c7fdf7e557a363c (diff) | |
download | ffmpeg-streaming-fe573d1a9b742652f44cdc15b24fdd401eefc5e7.zip ffmpeg-streaming-fe573d1a9b742652f44cdc15b24fdd401eefc5e7.tar.gz |
sws_allocVec: check length validity
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 24058c3..03e9463 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1415,7 +1415,12 @@ SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, SwsVector *sws_allocVec(int length) { - SwsVector *vec = av_malloc(sizeof(SwsVector)); + SwsVector *vec; + + if(length <= 0 || length > INT_MAX/ sizeof(double)) + return NULL; + + vec = av_malloc(sizeof(SwsVector)); if (!vec) return NULL; vec->length = length; |