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

Michael Niedermayer michaelni
Sun Aug 5 04:43:37 CEST 2007


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;
?

it seems like bad design ...

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

The educated differ from the uneducated as much as the living from the
dead. -- 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/20070805/2c923f32/attachment.pgp>



More information about the ffmpeg-devel mailing list