aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-15 21:19:06 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-16 02:24:01 +0200
commitc521f9a5cd8cabaf985eb06f87e9b7f7ad5fcaf2 (patch)
treea07e49d4b5e0275457a7d994ac8dfa415674ebd2
parent826515083a289e3e22250c59438b9fe554e71a46 (diff)
downloadffmpeg-c521f9a5cd8cabaf985eb06f87e9b7f7ad5fcaf2.tar.gz
avcodec/tiff: reset sampling[] if its invalid
Fixes divission by 0 Fixes: clusterfuzz-testcase-minimized-5592896440893440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit f08122fbe039a56ab3c24f74636b4b0efea97d85) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/tiff.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 9239a7c9ff..a0f4bff5cf 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1019,6 +1019,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
s->subsampling[i] = ff_tget(&s->gb, type, s->le);
if (s->subsampling[i] <= 0) {
av_log(s->avctx, AV_LOG_ERROR, "subsampling %d is invalid\n", s->subsampling[i]);
+ s->subsampling[i] = 1;
return AVERROR_INVALIDDATA;
}
}