diff mbox series

[FFmpeg-devel,1/2] avcodec/apedec: Fix invalid shift with 24 bps

Message ID 20200211225646.27195-1-michael@niedermayer.cc
State Accepted
Headers show
Series [FFmpeg-devel,1/2] avcodec/apedec: Fix invalid shift with 24 bps | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Michael Niedermayer Feb. 11, 2020, 10:56 p.m. UTC
Fixes: left shift of negative value -463
Fixes: 20542/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5688714435231744

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

Comments

Paul B Mahol Feb. 12, 2020, 9:41 a.m. UTC | #1
LGTM

On 2/11/20, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Fixes: left shift of negative value -463
> Fixes:
> 20542/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5688714435231744
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/apedec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
> index 0e749db63b..d643d6790e 100644
> --- a/libavcodec/apedec.c
> +++ b/libavcodec/apedec.c
> @@ -1555,7 +1555,7 @@ static int ape_decode_frame(AVCodecContext *avctx,
> void *data,
>          for (ch = 0; ch < s->channels; ch++) {
>              sample24 = (int32_t *)frame->data[ch];
>              for (i = 0; i < blockstodecode; i++)
> -                *sample24++ = s->decoded[ch][i] << 8;
> +                *sample24++ = s->decoded[ch][i] * 256;
>          }
>          break;
>      }
> --
> 2.17.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Michael Niedermayer Feb. 12, 2020, 4:05 p.m. UTC | #2
On Wed, Feb 12, 2020 at 10:41:21AM +0100, Paul B Mahol wrote:
> LGTM

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 0e749db63b..d643d6790e 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1555,7 +1555,7 @@  static int ape_decode_frame(AVCodecContext *avctx, void *data,
         for (ch = 0; ch < s->channels; ch++) {
             sample24 = (int32_t *)frame->data[ch];
             for (i = 0; i < blockstodecode; i++)
-                *sample24++ = s->decoded[ch][i] << 8;
+                *sample24++ = s->decoded[ch][i] * 256;
         }
         break;
     }