Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-09-19 00:42:02 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-26 17:50:58 +0300
commit37ac298e096002a0e0e240cdcad5c64a60870cba (patch)
treee6d9f05c7aef1d3ed0435662d2ad4b624e450549
parent5aecf2c1c03b53b8c69c2aea2f0b3d17a7e90915 (diff)
avcodec/mjpegdec: Check for unsupported bayer case
Fixes: out of array access Fixes: 51462/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-662559341582745 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 dd81cc22b3dd5bd6badf012b4fe4c19e062650f4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/mjpegdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 94dae34bd0..bcb1d4ea77 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1199,6 +1199,8 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int p
ptr[3*mb_x + 2] = buffer[mb_x][2] + ptr[3*mb_x + 1];
}
} else if (s->bayer) {
+ if (s->bits <= 8)
+ return AVERROR_PATCHWELCOME;
if (nb_components == 1) {
/* Leave decoding to the TIFF/DNG decoder (see comment in ff_mjpeg_decode_sof) */
for (mb_x = 0; mb_x < width; mb_x++)