[FFmpeg-devel] [PATCH] id3v2 unsynchronisation support

Alexander Kojevnikov alexander
Thu Jul 29 02:22:16 CEST 2010


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-id3v2-unsynchronisation-support.patch
Type: text/x-patch
Size: 5071 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100729/90e16be6/attachment.bin>



More information about the ffmpeg-devel mailing list