Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-27 03:18:52 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-10-27 03:24:51 +0400
commitfe573d1a9b742652f44cdc15b24fdd401eefc5e7 (patch)
treebd217b7cb554c893699db36fb071ab515ea8f4f7 /libswscale
parenta9d97e1b0af676c82abbf2673c7fdf7e557a363c (diff)
sws_allocVec: check length validity
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 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;