avcodec/osq: avoid signed overflow in downsample path

Fixes: signed integer overflow: 865309950 * 256 cannot be represented in type 'int'
Fixes: 69191/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6310214413385728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ed34b0c54e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/6.1
Michael Niedermayer 6 months ago
parent 85dbf6d8e4
commit 18025bf362
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      libavcodec/osq.c

@ -320,7 +320,7 @@ static int do_decode(AVCodecContext *avctx, AVFrame *frame, int decorrelate, int
cb->prev = prev;
if (downsample)
dst[n] *= 256;
dst[n] *= 256U;
dst[E] = dst[D];
dst[D] = dst[C];

Loading…
Cancel
Save