On Mon, Jul 14, 2025 at 08:58:52PM +0200, Michael Niedermayer wrote: > On Sun, Jul 13, 2025 at 07:37:06PM +0200, Andreas Rheinhardt wrote: > > Michael Niedermayer: > > > Fixes: signed integer overflow: 2147483565 + 128 cannot be represented in type 'int' > > > Fixes: 428055715/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6358069900804096 > > > > > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > > Signed-off-by: Michael Niedermayer > > > --- > > > libavcodec/osq.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/libavcodec/osq.c b/libavcodec/osq.c > > > index 76090aa8d07..1d99ab32451 100644 > > > --- a/libavcodec/osq.c > > > +++ b/libavcodec/osq.c > > > @@ -390,7 +390,7 @@ static int osq_decode_block(AVCodecContext *avctx, AVFrame *frame) > > > int32_t *src = s->decode_buffer[ch] + OFFSET; > > > > > > for (int n = 0; n < nb_samples; n++) > > > - dst[n] = av_clip_uint8(src[n] + 0x80); > > > + dst[n] = av_clip_uint8(src[n] + 0x80ll); > > > } > > > break; > > > case AV_SAMPLE_FMT_S16P: > > > > Why do you use a 64bit intermediate instead of simply using unsigned > > like we do everywhere else? > > we can use an unsigned but the intend was to clip obviously > and while the C code uses 64bit the optimized asm should not > need that > > Iam happy to change it to unsigned if you prefer no reply, will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates