aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/tiff.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-06-14 23:45:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-06-15 20:41:15 +0200
commit8e12af29d1a3f95c9e952d78354e3c8b1c0431a8 (patch)
tree195c84f951b0c2a2b7e30ca4dbf89fe59699073d /libavcodec/tiff.c
parent716b5c6ec9f856ea973298c8e319f041871080e7 (diff)
downloadffmpeg-n4.3.tar.gz
avcodec/tiff: Check stride for dngn4.3
Fixes: assertion failure Fixes: 23422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5746026064642048 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 276dfa9d91ee50183824612803891b7d066e8f00) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r--libavcodec/tiff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 010943c38c..dc24d055ec 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -679,6 +679,9 @@ static int tiff_unpack_strip(TiffContext *s, AVFrame *p, uint8_t *dst, int strid
return 0;
}
+ if (is_dng && stride == 0)
+ return AVERROR_INVALIDDATA;
+
for (line = 0; line < lines; line++) {
if (src - ssrc > size) {
av_log(s->avctx, AV_LOG_ERROR, "Source data overread\n");