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-06-30 01:52:20 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-01 01:41:28 +0300
commit5bf38f660c70d8726a9a4aef72ec8f8da256319c (patch)
treee7df2487168a6902c452ec980af30169e8cd9ab9
parentdac6f854a9b34e04023e58a976fa50ce89756def (diff)
avcodec/tiff: Check pixel format types for dng
Fixes: out of array access Fixes: 48271/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6149705769287680 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 75f3d1b82261f31c6bbcee8046cec6792194355a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/tiff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index fd85d104dc..7190f48310 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -759,6 +759,7 @@ static int tiff_unpack_strip(TiffContext *s, AVFrame *p, uint8_t *dst, int strid
if (s->is_bayer) {
av_assert0(width == (s->bpp * s->width + 7) >> 3);
}
+ av_assert0(!(s->is_bayer && is_yuv));
if (p->format == AV_PIX_FMT_GRAY12) {
av_fast_padded_malloc(&s->yuv_line, &s->yuv_line_size, width);
if (s->yuv_line == NULL) {
@@ -842,6 +843,8 @@ static int tiff_unpack_strip(TiffContext *s, AVFrame *p, uint8_t *dst, int strid
av_log(s->avctx, AV_LOG_ERROR, "More than one DNG JPEG strips unsupported\n");
return AVERROR_PATCHWELCOME;
}
+ if (!s->is_bayer)
+ return AVERROR_PATCHWELCOME;
if ((ret = dng_decode_jpeg(s->avctx, p, s->stripsize, 0, 0, s->width, s->height)) < 0)
return ret;
return 0;