[FFmpeg-devel] [PATCH] fix vorbis decoder amplitude bits handling

Yuriy Kaminskiy yumkam
Tue Nov 16 11:42:26 CET 2010


Baptiste Coudurier wrote:
> Hi
> 
> $subject. Please comment.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Index: libavcodec/vorbis_dec.c
> ===================================================================
> --- libavcodec/vorbis_dec.c	(revision 25756)
> +++ libavcodec/vorbis_dec.c	(working copy)
> @@ -563,6 +563,11 @@
>                       "Floor 0 amplitude bits is 0.\n");
>                return -1;
>              }
> +            if (floor_setup->data.t0.amplitude_bits > 32) {
Not enough, s/>/>=/, result of 1<<32 is undefined (and I'm sure code below
really broken on x86 when amplitude_bits == 32, resulting in divide-by-zero):
=== cut ===
                    q = exp((((amplitude*vf->amplitude_offset) /
                              (((1 << vf->amplitude_bits) - 1) * sqrt(p + q)))
                             - vf->amplitude_offset) * .11512925f);
=== cut ===




More information about the ffmpeg-devel mailing list