[FFmpeg-devel] [PATCH] alac: validate k before using show_bits in decode_scalar

Michael Niedermayer michaelni at gmx.at
Fri Apr 24 01:24:37 CEST 2015


On Fri, Apr 24, 2015 at 12:15:23AM +0200, Andreas Cadhalpun wrote:
> On 23.04.2015 23:37, Michael Niedermayer wrote:
> > On Thu, Apr 23, 2015 at 08:53:29PM +0200, Andreas Cadhalpun wrote:
> >> On 23.04.2015 16:37, Michael Niedermayer wrote:
> >>> On Wed, Apr 22, 2015 at 06:24:54PM +0200, Andreas Cadhalpun wrote:
> >>  libavcodec/alac.c | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >>
> >> diff --git a/libavcodec/alac.c b/libavcodec/alac.c
> >> index ffd2d77..16d56a7 100644
> >> --- a/libavcodec/alac.c
> >> +++ b/libavcodec/alac.c
> >> @@ -569,6 +569,10 @@ static int alac_set_info(ALACContext *alac)
> >>      alac->rice_history_mult    = bytestream2_get_byteu(&gb);
> >>      alac->rice_initial_history = bytestream2_get_byteu(&gb);
> >>      alac->rice_limit           = bytestream2_get_byteu(&gb);
> >> +    if (!alac->rice_limit) {
> >> +        avpriv_request_sample(alac->avctx, "Rice limit 0");
> >> +        return AVERROR(ENOSYS);
> >> +    }
> > 
> > this doesnt work as our encoder uses a rice_limit of 0 when
> > compression is disabled
> 
> I see.
> 
> > moving the check into if(is_compressed) should work hopefully
> 
> Done.
> 
> Best regards,
> Andreas
> 

>  alac.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 607ba39e0c617f9efc2db93b2788f666ffce3620  0001-alac-reject-rice_limit-0-if-compression-is-used.patch
> From 709c9f553387989633e4cb7416851c538884fdb0 Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> Date: Fri, 24 Apr 2015 00:01:43 +0200
> Subject: [PATCH] alac: reject rice_limit 0 if compression is used
> 
> If rice_limit is 0, k can be 0 in decode_scalar, which calls show_bits(gb, k).
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150424/fb463841/attachment.asc>


More information about the ffmpeg-devel mailing list