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

Tomas Härdin tomas.hardin
Tue Nov 16 08:53:59 CET 2010


On Mon, 2010-11-15 at 23:28 -0800, 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) {
> +                av_log(vc->avccontext, AV_LOG_ERROR,
> +                       "Floor 0 amplitude bits is > 32 bits.\n");
> +                return -1;

AVERROR_INVALIDDATA?

> +            }
>              floor_setup->data.t0.amplitude_offset = get_bits(gb, 8);
>              floor_setup->data.t0.num_books        = get_bits(gb, 4) +
> 1;
>  
> @@ -1024,7 +1029,7 @@
>      uint_fast32_t book_idx;
>      uint_fast8_t blockflag = vc->modes[vc->mode_number].blockflag;
>  
> -    amplitude = get_bits(&vc->gb, vf->amplitude_bits);
> +    amplitude = get_bits_long(&vc->gb, vf->amplitude_bits);
>      if (amplitude > 0) {
>          float last = 0;
>          uint_fast16_t lsp_len = 0;

/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101116/0affcd1d/attachment.pgp>



More information about the ffmpeg-devel mailing list