diff mbox

[FFmpeg-devel,4/5] avcodec/eac3dec: Fix runtime error: left shift of negative value -3

Message ID 20170225200726.7928-4-michael@niedermayer.cc
State Accepted
Commit 87eb3749708c0eb2978f4812c7be2a4af667fdb7
Headers show

Commit Message

Michael Niedermayer Feb. 25, 2017, 8:07 p.m. UTC
Fixes: 672/clusterfuzz-testcase-5595018867769344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/eac3dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Feb. 25, 2017, 9:02 p.m. UTC | #1
On 2/25/17, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Fixes: 672/clusterfuzz-testcase-5595018867769344
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/eac3dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

lgtm
Michael Niedermayer Feb. 26, 2017, 3:33 p.m. UTC | #2
On Sat, Feb 25, 2017 at 10:02:21PM +0100, Paul B Mahol wrote:
> On 2/25/17, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > Fixes: 672/clusterfuzz-testcase-5595018867769344
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/eac3dec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> 
> lgtm

applied

thx

[...]
Kieran Kunhya Feb. 26, 2017, 8:33 p.m. UTC | #3
On Sat, 25 Feb 2017 at 20:08 Michael Niedermayer <michael@niedermayer.cc>
wrote:

> Fixes: 672/clusterfuzz-testcase-5595018867769344
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
> Signed-off-by
> <https://github.com/google/oss-fuzz/tree/master/targets/ffmpegSigned-off-by>:
> Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/eac3dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c
> index be2350237e..c971879b2d 100644
> --- a/libavcodec/eac3dec.c
> +++ b/libavcodec/eac3dec.c
> @@ -280,7 +280,7 @@ static void
> ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
>                      mant +=
> ((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] * (int64_t)mant) >> 15) + b;
>                  } else {
>                      /* small mantissa, no GAQ, or Gk=1 */
> -                    mant <<= 24 - bits;
> +                    mant *= (1 << 24 - bits);
>
>
How is this possible?  ff_eac3_bits_vs_hebap doesn't have a value that
causes this.

Kieran
Kieran Kunhya Feb. 27, 2017, 11:49 p.m. UTC | #4
On Sun, 26 Feb 2017 at 20:33 Kieran Kunhya <kierank@obe.tv> wrote:

> On Sat, 25 Feb 2017 at 20:08 Michael Niedermayer <michael@niedermayer.cc>
> wrote:
>
> Fixes: 672/clusterfuzz-testcase-5595018867769344
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
> Signed-off-by
> <https://github.com/google/oss-fuzz/tree/master/targets/ffmpegSigned-off-by>:
> Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/eac3dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c
> index be2350237e..c971879b2d 100644
> --- a/libavcodec/eac3dec.c
> +++ b/libavcodec/eac3dec.c
> @@ -280,7 +280,7 @@ static void
> ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
>                      mant +=
> ((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] * (int64_t)mant) >> 15) + b;
>                  } else {
>                      /* small mantissa, no GAQ, or Gk=1 */
> -                    mant <<= 24 - bits;
> +                    mant *= (1 << 24 - bits);
>
>
> How is this possible?  ff_eac3_bits_vs_hebap doesn't have a value that
> causes this.
>

Ignore this
diff mbox

Patch

diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c
index be2350237e..c971879b2d 100644
--- a/libavcodec/eac3dec.c
+++ b/libavcodec/eac3dec.c
@@ -280,7 +280,7 @@  static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
                     mant += ((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] * (int64_t)mant) >> 15) + b;
                 } else {
                     /* small mantissa, no GAQ, or Gk=1 */
-                    mant <<= 24 - bits;
+                    mant *= (1 << 24 - bits);
                     if (!log_gain) {
                         /* remap mantissa value for no GAQ or Gk=1 */
                         mant += (ff_eac3_gaq_remap_1[hebap-8] * (int64_t)mant) >> 15;