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

Mike Melanson mike
Sat Mar 1 02:50:10 CET 2008


Michael Niedermayer wrote:
> 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.

I'm a bit confused. Where am I doing struct memcpy() operations in the 
patch?

-- 
	-Mike Melanson




More information about the ffmpeg-devel mailing list