[flac-dev] Metadata block max size

lvqcl lvqcl.mail at gmail.com
Fri Jun 20 01:07:31 PDT 2014


Pierre-Yves Thoulon wrote:

> METADATA_BLOCK_HEADER has a 24-bit field to encode the length of
> METADATA_BLOCK_DATA ; hence the limitation (which not only applies
> to METADATA_BLOCK_PICTURE but all metadata blocks.

I see. So it's possible to abuse some other metadata blocks too..
I found the following checks in libFLAC and metaflac sources:

src/libFLAC/metadata_iterators.c, write_metadata_block_header_cb_(...):

     FLAC__ASSERT(block->length < (1u << FLAC__STREAM_METADATA_LENGTH_LEN));



src/libFLAC/stream_encoder_framing.c, FLAC__add_metadata_block(...):

     FLAC__ASSERT(i < (1u << FLAC__STREAM_METADATA_LENGTH_LEN));



src/metaflac/options.c, FLAC__bool parse_add_padding(...):

     return *out < (1u << FLAC__STREAM_METADATA_LENGTH_LEN);



More information about the flac-dev mailing list