Fix endless loop in foreign metadata handling (#725)

Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58545
This commit is contained in:
Martijn van Beurden 2024-07-14 19:48:41 +02:00 committed by GitHub
parent d48b689ae8
commit 3468459d44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -396,6 +396,10 @@ static FLAC__bool read_from_wave64_(foreign_metadata_t *fm, FILE *f, const char
/* check if pad bytes needed */
if(size & 7)
size = (size+7) & (~((FLAC__uint64)7));
if(size < 24) {
if(error) *error = "invalid Wave64 file: chunk length invalid";
return false;
}
/* fmt GUID 20746D66-ACF3-11D3-8CD1-00C04F8EDB8A */
if(!memcmp(buffer, "\x66\x6D\x74\x20\xF3\xAC\xD3\x11\x8C\xD1\x00\xC0\x4F\x8E\xDB\x8A", 16)) {
if(fm->format_block) {