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-20 03:41:34 +0200
commita1778b8cdda75757956a414c036da7326e4cac2e (patch)
tree4890788c57429e5f5c3ec01c2eaf274666323056
parentaa941e9aa9d5f5cea07f7d93d6f2c37021c72d3d (diff)
downloadffmpeg-a1778b8cdda75757956a414c036da7326e4cac2e.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 af433d9a4e..dac406862d 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1018,6 +1018,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;
}
}