Message ID | 20221218170823.32130-5-michael@niedermayer.cc |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,1/5] avcodec/tiff: Check camera_calibration for 0 | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On 12/18/22, Michael Niedermayer <michael@niedermayer.cc> wrote: > Fixes: left shift of 1208485947 by 1 places cannot be represented in type > 'int' > Fixes: > 54058/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5827521084260352 > Please use something else than casting. > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/wavpack.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c > index 3cb4077550..42859ab0a1 100644 > --- a/libavcodec/wavpack.c > +++ b/libavcodec/wavpack.c > @@ -129,7 +129,7 @@ static av_always_inline unsigned get_tail(GetBitContext > *gb, unsigned k) > e = (1LL << (p + 1)) - k - 1; > res = get_bits_long(gb, p); > if (res >= e) > - res = (res << 1) - e + get_bits1(gb); > + res = ((unsigned)res << 1) - e + get_bits1(gb); > return res; > } > > -- > 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". >
On Sun, Dec 18, 2022 at 07:14:27PM +0100, Paul B Mahol wrote: > On 12/18/22, Michael Niedermayer <michael@niedermayer.cc> wrote: > > Fixes: left shift of 1208485947 by 1 places cannot be represented in type > > 'int' > > Fixes: > > 54058/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5827521084260352 > > > > Please use something else than casting. ok will apply with * 2U thx [...]
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 3cb4077550..42859ab0a1 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -129,7 +129,7 @@ static av_always_inline unsigned get_tail(GetBitContext *gb, unsigned k) e = (1LL << (p + 1)) - k - 1; res = get_bits_long(gb, p); if (res >= e) - res = (res << 1) - e + get_bits1(gb); + res = ((unsigned)res << 1) - e + get_bits1(gb); return res; }
Fixes: left shift of 1208485947 by 1 places cannot be represented in type 'int' Fixes: 54058/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5827521084260352 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/wavpack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)