mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
max the largest metadata type code be 126, reserving 127 to avoid confusion with a frame sync code
This commit is contained in:
@@ -402,9 +402,9 @@ FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecode
|
||||
FLAC__ASSERT(0 != decoder);
|
||||
FLAC__ASSERT(0 != decoder->private_);
|
||||
FLAC__ASSERT(0 != decoder->protected_);
|
||||
FLAC__ASSERT((unsigned)type < (1u << FLAC__STREAM_METADATA_TYPE_LEN));
|
||||
FLAC__ASSERT((unsigned)type <= FLAC__MAX_METADATA_TYPE_CODE);
|
||||
/* double protection */
|
||||
if((unsigned)type >= (1u << FLAC__STREAM_METADATA_TYPE_LEN))
|
||||
if((unsigned)type > FLAC__MAX_METADATA_TYPE_CODE)
|
||||
return false;
|
||||
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
|
||||
return false;
|
||||
@@ -459,9 +459,9 @@ FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder
|
||||
FLAC__ASSERT(0 != decoder);
|
||||
FLAC__ASSERT(0 != decoder->private_);
|
||||
FLAC__ASSERT(0 != decoder->protected_);
|
||||
FLAC__ASSERT((unsigned)type < (1u << FLAC__STREAM_METADATA_TYPE_LEN));
|
||||
FLAC__ASSERT((unsigned)type <= FLAC__MAX_METADATA_TYPE_CODE);
|
||||
/* double protection */
|
||||
if((unsigned)type >= (1u << FLAC__STREAM_METADATA_TYPE_LEN))
|
||||
if((unsigned)type > FLAC__MAX_METADATA_TYPE_CODE)
|
||||
return false;
|
||||
if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user