mirror of https://git.ffmpeg.org/ffmpeg.git
sws_allocVec: check length validity
Found-by: Reimar Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a9d97e1b0a
commit
fe573d1a9b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue