[FFmpeg-devel] [PATCH] adpcm big frames decoding fix

Baptiste Coudurier baptiste.coudurier
Sun Aug 5 15:42:03 CEST 2007


Michael Niedermayer wrote:
> Hi
> 
> On Sun, Aug 05, 2007 at 01:33:03PM +0200, Baptiste Coudurier wrote:
>> Hi
>>
>> Michael Niedermayer wrote:
>>> Hi
>>>
>>> On Sun, Aug 05, 2007 at 03:49:02AM +0200, Baptiste Coudurier wrote:
>>>> Hi
>>>>
>>>> Here is a patch to fix big adpcm swf frames decoding. Frames wrap at
>>>> 4096 samples per channel.
>>>>
>>>> Fix RamboMJPEGAVP6_1Mbps.swf.
>>> [...]
>>>
>>>> Index: libavcodec/adpcm.c
>>>> ===================================================================
>>>> --- libavcodec/adpcm.c	(revision 9871)
>>>> +++ libavcodec/adpcm.c	(working copy)
>>>> @@ -1274,7 +1274,7 @@
>>>>      {
>>>>          GetBitContext gb;
>>>>          const int *table;
>>>> -        int k0, signmask, nb_bits;
>>>> +        int k0, signmask, nb_bits, count;
>>>>          int size = buf_size*8;
>>>>  
>>>>          init_get_bits(&gb, buf, size);
>>>> @@ -1286,12 +1286,13 @@
>>>>          k0 = 1 << (nb_bits-2);
>>>>          signmask = 1 << (nb_bits-1);
>>>>  
>>>> +        while (get_bits_count(&gb) <= size - 22*avctx->channels) {
>>> are you sure this is not supposed to be above 
>>> nb_bits = get_bits(&gb, 2)+2;
>> I double checked, and the file doesn't decode in that case.
>>
>>> it seems like bad design ...
>> :)
>> It seems quite correct according to what is written in specs at least.
> 
> yes but the spec is bad design
> 
> anyway it cant be helped, my timemachine isnt finished yet so i cant give
> the father of the guy who designed this a condom ...
> 
> so patch ok
> 

Applied.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312




More information about the ffmpeg-devel mailing list