[FFmpeg-devel] [PATCH 3/4] avcodec/g723_1dec: fix invalid shift with negative sid_gain

Paul B Mahol onemda at gmail.com
Sun Oct 27 13:55:32 EET 2019


lgtm

On 10/27/19, Michael Niedermayer <michael at niedermayer.cc> wrote:
> Fixes: left shift of negative value -1
> Fixes:
> 18395/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G723_1_fuzzer-5710313034350592
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavcodec/g723_1dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c
> index a7bf528470..f601d31d00 100644
> --- a/libavcodec/g723_1dec.c
> +++ b/libavcodec/g723_1dec.c
> @@ -677,7 +677,7 @@ static int estimate_sid_gain(G723_1_ChannelContext *p)
>              if (p->sid_gain < 0) t = INT32_MIN;
>              else                 t = INT32_MAX;
>          } else
> -            t = p->sid_gain << shift;
> +            t = p->sid_gain * (1 << shift);
>      } else if(shift < -31) {
>          t = (p->sid_gain < 0) ? -1 : 0;
>      }else
> --
> 2.23.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list