Displaying 6 results from an estimated 6 matches for "entry_length_len".
2014 Sep 26
0
Patch to improve malformed vorbiscomment handling
...lback_Read read_cb, FLAC__StreamMetadata_VorbisComment_Entry *entry)
+FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_vorbis_comment_entry_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_VorbisComment_Entry *entry, unsigned max_length)
{
const unsigned entry_length_len = FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8;
FLAC__byte buffer[4]; /* magic number is asserted below */
FLAC__ASSERT(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8 == sizeof(buffer));
+ if(max_length < entry_length_len) return FLAC__METADATA_SIMPLE_ITERATOR_STA...
2014 Sep 26
2
Patch to improve malformed vorbiscomment handling
Janne Hyv?rinen wrote:
> Patch v2, now handles more malformed cases. Original patch was for a
> file for which I had a sample from a user but this allows handling some
> manually broken test cases.
Err, I'm getting warning messages on that patch:
CC metadata_iterators.lo
metadata_iterators.c: In function ?read_metadata_block_data_vorbis_comment_cb_?:
2014 Sep 26
0
Patch to improve malformed vorbiscomment handling
...lback_Read read_cb, FLAC__StreamMetadata_VorbisComment_Entry *entry)
+FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_vorbis_comment_entry_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_VorbisComment_Entry *entry, unsigned max_length)
{
const unsigned entry_length_len = FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8;
FLAC__byte buffer[4]; /* magic number is asserted below */
FLAC__ASSERT(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8 == sizeof(buffer));
+ if(max_length < entry_length_len) return FLAC__METADATA_CHAIN_STATUS_BAD_ME...
2014 Sep 25
2
Patch to improve malformed vorbiscomment handling
...)
{
FLAC__uint32 i;
FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
+ if (length < 8) return false; /* vendor string length + num comments entries alone take 8 bytes */
/* read vendor string */
FLAC__ASSERT(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN == 32);
if(!FLAC__bitreader_read_uint32_little_endian(decoder->private_->input, &obj->vendor_string.length))
return false; /* read_callback_ sets the state for us */
+ length -= 8;
if(obj->vendor_string.length > 0) {
+ if (length < obj->vendor_string.length) return...
2012 Apr 05
2
[PATCH 2/2] V2: Use a single definition of MIN and MAX in sources
...7 @@ FLAC__bool write_metadata_block_data_vorbis_comment_cb_(FLAC__IOHandle handle, F
const unsigned num_comments_len = FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN / 8;
FLAC__byte buffer[4]; /* magic number is asserted below */
- FLAC__ASSERT(max(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN, FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN) / 8 == sizeof(buffer));
+ FLAC__ASSERT(flac_max(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN, FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN) / 8 == sizeof(buffer));
pack_uint32_little_endian_(block->vendor_string.length...
2004 Sep 10
3
new checkins
FYI, I have checked in a few interesting things. One is a
speedup to the decoder (about 15% improvement in overall
decode time). Another is a new interface to FLAC file
metadata. If you're curious look at include/FLAC/metadata.h.
It is basically a collection of object manipulation routines
and iterators that make it pretty easy to add/edit/delete
FLAC metadata in files efficiently. The