Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cores/genesis/core/cd_hw/libchdr/deps/libFLAC/bitreader.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[
cwords = br->consumed_words;
words = br->words;
ucbits = FLAC__BITS_PER_WORD - br->consumed_bits;
b = br->buffer[cwords] << br->consumed_bits;
b = cwords < br->capacity ? br->buffer[cwords] << br->consumed_bits : 0;
} while(cwords >= words && val < end);
}

Expand Down
2 changes: 1 addition & 1 deletion cores/pce/deps/flac-1.3.2/src/libFLAC/bitreader.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[
cwords = br->consumed_words;
words = br->words;
ucbits = FLAC__BITS_PER_WORD - br->consumed_bits;
b = br->buffer[cwords] << br->consumed_bits;
b = cwords < br->capacity ? br->buffer[cwords] << br->consumed_bits : 0;

Copilot AI Dec 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This security fix appears to only address one instance of the FLAC library in this repository. The Genesis core also has a copy of the FLAC library at cores/genesis/core/cd_hw/libchdr/deps/libFLAC/bitreader.c that contains the same vulnerability at line 862. Consider applying the same fix to that location to ensure comprehensive protection against CVE-2020-0499.

Suggested change
b = cwords < br->capacity ? br->buffer[cwords] << br->consumed_bits : 0;
b = cwords < words ? br->buffer[cwords] << br->consumed_bits : 0;

Copilot uses AI. Check for mistakes.
} while(cwords >= words && val < end);
}

Expand Down
Loading