flvdec: Check for overflow before allocating arrays
On allocation, the array length is multiplied by sizeof(int64_t), this prevents the multiplication from overflowing. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
committed by
Martin Storsjö
parent
9b921a8272
commit
a246cefa75
@ -161,6 +161,9 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
arraylen = avio_rb32(ioc);
|
arraylen = avio_rb32(ioc);
|
||||||
|
if (arraylen >> 28)
|
||||||
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expect only 'times' or 'filepositions' sub-arrays in other case refuse to use such metadata
|
* Expect only 'times' or 'filepositions' sub-arrays in other case refuse to use such metadata
|
||||||
* for indexing
|
* for indexing
|
||||||
|
Reference in New Issue
Block a user