[FFmpeg-devel] [PATCH] fix wc3 xan decoder

Michael Niedermayer michaelni
Sat Mar 1 02:45:45 CET 2008


On Fri, Feb 29, 2008 at 05:40:19PM -0800, Mike Melanson wrote:
> Hi,
>
> This patch fixes the WC3 Xan decoder by correcting the frame accounting. 
> Previously, it would only decode the first frame and then complain about 
> not being able to get another frame.
>
> (Kostya: I haven't forgotten about your WC4 Xan patch. One day. :) )
>
> -- 
> 	-Mike Melanson

> Index: libavcodec/xan.c
> ===================================================================
> --- libavcodec/xan.c	(revision 12279)
> +++ libavcodec/xan.c	(working copy)
> @@ -435,12 +435,13 @@
>      if (s->last_frame.data[0])
>          avctx->release_buffer(avctx, &s->last_frame);
>  
> +    *data_size = sizeof(AVFrame);
> +    *(AVFrame*)data = s->current_frame;
> +
>      /* shuffle frames */
>      s->last_frame = s->current_frame;

Copying the frames around like that is a recipe for problems
you should shuffle pointers not memcpy structs.

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

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- 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/20080301/fc23b2dc/attachment.pgp>



More information about the ffmpeg-devel mailing list