[FFmpeg-devel] [PATCH] Add IFF metadata handling
Vladimir Pantelic
pan
Mon May 3 15:52:25 CEST 2010
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?
More information about the ffmpeg-devel
mailing list