Add check for samplerate == 0 when parsing cuesheets

Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58199
This commit is contained in:
Martijn van Beurden 2023-04-24 10:47:05 +02:00
parent dd288d2f23
commit 3e3b4407ae
1 changed files with 6 additions and 0 deletions

View File

@ -69,6 +69,12 @@ FLAC__bool do_shorthand_operation__cuesheet(const char *filename, FLAC__Metadata
return false;
}
if(sample_rate == 0) {
flac_fprintf(stderr, "%s: ERROR: cannot parse cuesheet when sample rate is unknown\n", filename);
FLAC__metadata_iterator_delete(iterator);
return false;
}
switch(operation->type) {
case OP__IMPORT_CUESHEET_FROM:
if(0 != cuesheet) {