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>
release/6.1
Michael Niedermayer 8 months ago
parent 18025bf362
commit 02606b6ae4
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      libavcodec/flac_parser.c

@ -519,6 +519,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…
Cancel
Save