aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-15 21:19:06 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 13:15:17 +0200
commit9252b3ca23e3d365fea624df9786c00e1964382d (patch)
tree156693caaee7e7bc1c2d907446fde02c1342d67c
parent4954a78d337c73893938bd60f814e185cfba4f41 (diff)
downloadffmpeg-9252b3ca23e3d365fea624df9786c00e1964382d.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 c5d5896f9a..37d8bcba1b 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;
}
}