Check that seektable length > 0

This commit is contained in:
Martijn van Beurden 2023-06-01 16:50:27 +02:00 committed by GitHub
parent d6974b9702
commit 6a9c1664b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1415,6 +1415,7 @@ FLAC__bool read_metadata_(FLAC__StreamDecoder *decoder)
/* just in case we already have a seek table, and reading the next one fails: */
decoder->private_->has_seek_table = false;
if(length > 0) {
if(!read_metadata_seektable_(decoder, is_last, length))
return false;
@ -1422,6 +1423,7 @@ FLAC__bool read_metadata_(FLAC__StreamDecoder *decoder)
if(!decoder->private_->is_seeking && decoder->private_->metadata_filter[FLAC__METADATA_TYPE_SEEKTABLE] && decoder->private_->metadata_callback)
decoder->private_->metadata_callback(decoder, &decoder->private_->seek_table, decoder->private_->client_data);
}
}
else {
FLAC__bool skip_it = !decoder->private_->metadata_filter[type];
uint32_t real_length = length;