[FFmpeg-devel] [PATCH] id3v2 unsynchronisation support

Alexander Kojevnikov alexander
Mon Aug 2 01:41:26 CEST 2010


On 29 July 2010 10:22, Alexander Kojevnikov <alexander at kojevnikov.com> wrote:
> On 29 July 2010 00:50, Michael Niedermayer <michaelni at gmx.at> wrote:
>> On Tue, Jul 27, 2010 at 07:50:48PM +1000, Alexander Kojevnikov wrote:
>> [...]
>>> @@ -183,15 +186,15 @@ void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
>>> ? ? ? ? ?goto error;
>>> ? ? ?}
>>>
>>> - ? ?if (flags & 0x80) {
>>> - ? ? ? ?reason = "unsynchronization";
>>> - ? ? ? ?goto error;
>>> - ? ?}
>>> + ? ?unsync = (flags & 0x80) != 0;
>>
>> the ?() != 0 is unneeded
>
> Fixed in both places.
>
>> [...]
>>> + ? ? ? ? ? ? ? ?if (!buffer_size) {
>>> + ? ? ? ? ? ? ? ? ? ?buffer = av_malloc(tlen);
>>> + ? ? ? ? ? ? ? ? ? ?buffer_size = tlen;
>>> + ? ? ? ? ? ? ? ?} else if (buffer_size < tlen) {
>>> + ? ? ? ? ? ? ? ? ? ?buffer = av_realloc(buffer, tlen);
>>> + ? ? ? ? ? ? ? ? ? ?buffer_size = tlen;
>>> + ? ? ? ? ? ? ? ?}
>>
>> why not just
>> av_malloc()
>
> Changed.
>
>> btw, is this buffer freed too ?
>
> Fixed. By the way, I didn't include `if(buffer)` checks because of
> tools/patcheck warnings.
>

Ping.



More information about the ffmpeg-devel mailing list