[FFmpeg-devel] [PATCH] deobfuscate ff_interleave_add_packet

Michael Niedermayer michaelni
Sat Apr 11 20:42:06 CEST 2009


On Sat, Apr 11, 2009 at 02:54:23PM +0200, Reimar D?ffinger wrote:
> Hello,
> I propose this change:
> Index: libavformat/utils.c
> ===================================================================
> --- libavformat/utils.c (revision 18431)
> +++ libavformat/utils.c (working copy)
> @@ -2613,10 +2613,8 @@
>  
>      this_pktl = av_mallocz(sizeof(AVPacketList));
>      this_pktl->pkt= *pkt;
> -    if(pkt->destruct == av_destruct_packet)
> -        pkt->destruct= NULL; // not shared -> must keep original from being freed
> -    else
> -        av_dup_packet(&this_pktl->pkt);  //shared -> must dup
> +    pkt->destruct= NULL; // do not free original but only the copy
> +    av_dup_packet(&this_pktl->pkt);  // duplicate the packet if it uses non-alloced memory
>  
>      next_point = &s->packet_buffer;
>      while(*next_point){

probably ok
please vertically align the comments though


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090411/c0e5512a/attachment.pgp>



More information about the ffmpeg-devel mailing list