Commit fe573d1a authored by Michael Niedermayer's avatar Michael Niedermayer

sws_allocVec: check length validity

Found-by: Reimar
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a9d97e1b
...@@ -1415,7 +1415,12 @@ SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, ...@@ -1415,7 +1415,12 @@ SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
SwsVector *sws_allocVec(int length) 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) if (!vec)
return NULL; return NULL;
vec->length = length; vec->length = length;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment