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

Michael Niedermayer michaelni
Sun Aug 5 13:41:54 CEST 2007


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

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

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- 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/20070805/8aed7fd7/attachment.pgp>



More information about the ffmpeg-devel mailing list