History

avcodec/flac_parser: Assert that we do not overrun the link_penalty array

Helps: CID1454676 Out-of-bounds read

Michael Niedermayer committed 2 years ago

Commit 9af348b1 parent ed34b0c1 file · +2 −0Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/flac_parser.c+2−0
@@ -518,6 +518,8 @@ static int check_header_mismatch(FLACParseContext *fpc, · 517 unmodified lines
518 for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS && curr != child; i++)518 for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS && curr != child; i++)
519 curr = curr->next;519 curr = curr->next;
520 520
521 av_assert0(i < FLAC_MAX_SEQUENTIAL_HEADERS);
522
521 if (header->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY ||523 if (header->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY ||
522 header->link_penalty[i] == FLAC_HEADER_NOT_PENALIZED_YET) {524 header->link_penalty[i] == FLAC_HEADER_NOT_PENALIZED_YET) {
523 FLACHeaderMarker *start, *end;525 FLACHeaderMarker *start, *end;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t