aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-27 01:18:52 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-27 01:24:51 +0200
commitfe573d1a9b742652f44cdc15b24fdd401eefc5e7 (patch)
treebd217b7cb554c893699db36fb071ab515ea8f4f7
parenta9d97e1b0af676c82abbf2673c7fdf7e557a363c (diff)
downloadffmpeg-fe573d1a9b742652f44cdc15b24fdd401eefc5e7.tar.gz
sws_allocVec: check length validity
Found-by: Reimar Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libswscale/utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 24058c3b0c..03e9463773 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;