[FFmpeg-devel] [PATCH] Add IFF metadata handling
Sebastian Vater
cdgs.basty
Mon May 3 20:48:11 CEST 2010
Sebastian Vater a ?crit :
> Vladimir Pantelic a ?crit :
>
>> Sebastian Vater wrote:
>>
>>> Sebastian Vater a ?crit :
>>>
>>>> Oh yes, you're right. Fixed!
>>>>
>>>>
>>> Oops, just forgot a const...fixed!
>>>
>> +static char *get_metadata(AVFormatContext *s,
>> + const char *const tag,
>> + const unsigned data_size)
>> +{
>> + char *buf = av_malloc(data_size + 1);
>> + if (buf) {
>> + get_buffer(s->pb, buf, data_size);
>> + buf[data_size] = 0;
>> + }
>> + av_metadata_set2(&s->metadata, tag, buf,
>> AV_METADATA_DONT_STRDUP_VAL);
>> +
>> + return buf;
>> +}
>> +
>>
>> you call av_metadata_set2() on a buf that could be NULL?
>>
>
> Oh damn! Fixed!
>
Please ignore the previous patches. I just found a better way to handle
this.
Reason is that I figured out that the original code didn't check even if
get_buffer succeeds...
I have changed the metadata handling in a way it returns an appreciate
I/O error instead.
So, enjoy this new patch!
--
Best regards,
:-) Basty/CDGS (-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iff-metadata.patch
Type: text/x-patch
Size: 2652 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100503/98b3a1a5/attachment.bin>
More information about the ffmpeg-devel
mailing list