[FFmpeg-devel] [PATCHv5 3/3] vorbis: extract metadata from the middle of a stream

Ben Boeckel mathstuf at gmail.com
Sun Jan 19 02:33:25 CET 2014


On Fri, 17 Jan, 2014 at 22:08:35 GMT, Michael Niedermayer wrote:
>> -    ff_metadata_conv(m, NULL, ff_vorbiscomment_metadata_conv);
>> +    if (m)
>> +        ff_metadata_conv(m, NULL, ff_vorbiscomment_metadata_conv);
>
> ive fixed ff_metadata_conv() so it doesnt need this

Done.

>> +    /* New metadata packet; release old data. */
>> +    av_dict_free(&st->metadata);
>
> i hope midstream reallocation of metadata wont cause any problems

I haven't noticed anything with mpv so far. Looking through usages of
AVStream->metadata (detected by deprecating the field then looking at
the warnings) to see if there's anything to worry about, there's no
place where AVStream->metadata is stored other than a local variable
(usually for switching between AVFormatContext->metadata and
AVStream->metadata).

>> +        os->new_metadata =3D malloc(1);
>
> av_malloc() otherwise this ca cause some nasty memory corruption
> when its av_freed()

Done.

--Ben



More information about the ffmpeg-devel mailing list