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

Unified · Split

libavcodec/flac_parser.c+2−0
@@ -518,6 +518,8 @@ static int check_header_mismatch(FLACParseContext *fpc, · 517 unmodified lines
518518 for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS && curr != child; i++)
519519 curr = curr->next;
520520
521+ av_assert0(i < FLAC_MAX_SEQUENTIAL_HEADERS);
522+
521523 if (header->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY ||
522524 header->link_penalty[i] == FLAC_HEADER_NOT_PENALIZED_YET) {
523525 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