[FFmpeg-devel] [PATCH] id3v2 unsynchronisation support

Michael Niedermayer michaelni
Mon Aug 9 14:52:00 CEST 2010


On Thu, Jul 29, 2010 at 10:22:16AM +1000, Alexander Kojevnikov wrote:
[...]

>  
>          next = url_ftell(s->pb) + tlen;
>  
> -        if (tag[0] == 'T')
> -            read_ttag(s, tlen, tag);
> +        if (tag[0] == 'T') {
> +            if (unsync || tunsync) {
> +                int i, j;
> +                if (buffer_size < tlen) {
> +                    av_free(buffer);
> +                    buffer = av_malloc(tlen);
> +                    buffer_size = tlen;
> +                }

why not allways av_realloc() ?
av_realloc(NULL) == av_malloc()


[...]
> @@ -230,6 +253,8 @@ void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
>      }
>      if (version == 4 && flags & 0x10) /* Footer preset, always 10 bytes, skip over it */
>          url_fskip(s->pb, 10);
> +
> +    av_free(buffer);
>      return;
>  
>    error:

this looks like a recipe for a memleak

> -- 
> 1.7.2
> 

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100809/ef7f5675/attachment.pgp>



More information about the ffmpeg-devel mailing list