[FFmpeg-devel] [PATCH 2/3] vorbisdec: replace get_bits with get_bitsz where n can be 0

Michael Niedermayer michael at niedermayer.cc
Mon Jan 4 02:31:07 CET 2016


On Sun, Jan 03, 2016 at 11:44:02PM +0100, Andreas Cadhalpun wrote:
> On 03.01.2016 22:50, Michael Niedermayer wrote:
> > On Sun, Jan 03, 2016 at 07:50:39PM +0100, Andreas Cadhalpun wrote:
> >>  vorbisdec.c |    5 +++++
> >>  1 file changed, 5 insertions(+)
> >> ba151dadb72b6c74e1139decf4b32c8676ddc58e  0001-vorbisdec-reject-rangebits-0.patch
> >> From d740a59b6e099c90504d55c65923def1ad6de234 Mon Sep 17 00:00:00 2001
> >> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> >> Date: Sun, 3 Jan 2016 19:11:24 +0100
> >> Subject: [PATCH 1/2] vorbisdec: reject rangebits 0
> >>
> >> This causes non-unique elements in floor_setup->data.t1.list, which
> >> makes the stream undecodable according to the specification.
> >>
> >> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> >> ---
> >>  libavcodec/vorbisdec.c | 5 +++++
> >>  1 file changed, 5 insertions(+)
> >>
> >> diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
> >> index f773afa..2792af1 100644
> >> --- a/libavcodec/vorbisdec.c
> >> +++ b/libavcodec/vorbisdec.c
> >> @@ -573,6 +573,11 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
> >>                  return AVERROR(ENOMEM);
> >>  
> >>              rangebits = get_bits(gb, 4);
> >> +            if (!rangebits) {
> >> +                av_log(vc->avctx, AV_LOG_ERROR,
> >> +                       "A rangebits value of 0 is not compliant with the Vorbis I specification.\n");
> >> +                return AVERROR_INVALIDDATA;
> >> +            }
> > 
> > this assumes partitions > 0
> > iam not sure if this is required or not, the spec does not seem to
> > explicitly state it
> 
> OK, so let's only error out if partitions is > 0.
> Updated patch attached.
> 
> Best regards,
> Andreas
> 

>  vorbisdec.c |    5 +++++
>  1 file changed, 5 insertions(+)
> cb124c1de2cdbe783b2217af90f082cbc6e0a29f  0001-vorbisdec-reject-rangebits-0-with-non-0-partitions.patch
> From 37170226888eb08fe1d98e31bed4a0a8199bd7e3 Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> Date: Sun, 3 Jan 2016 19:11:24 +0100
> Subject: [PATCH] vorbisdec: reject rangebits 0 with non-0 partitions
> 
> This causes non-unique elements in floor_setup->data.t1.list, which
> makes the stream undecodable according to the specification.
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavcodec/vorbisdec.c | 5 +++++
>  1 file changed, 5 insertions(+)

LGTM

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160104/930e09b5/attachment.sig>


More information about the ffmpeg-devel mailing list