mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/flac_parser: Assert that we do not overrun the link_penalty array
Helps: CID1454676 Out-of-bounds read
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9af348bd1a
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
11cdd99585
commit
bc5f841688
@ -359,6 +359,8 @@ static int check_header_mismatch(FLACParseContext *fpc,
|
||||
for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS && curr != child; i++)
|
||||
curr = curr->next;
|
||||
|
||||
av_assert0(i < FLAC_MAX_SEQUENTIAL_HEADERS);
|
||||
|
||||
if (header->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY ||
|
||||
header->link_penalty[i] == FLAC_HEADER_NOT_PENALIZED_YET) {
|
||||
FLACHeaderMarker *start, *end;
|
||||
|
Loading…
Reference in New Issue
Block a user