diff options
author | Michael Niedermayer | 2017-05-15 21:19:06 +0200 |
---|---|---|
committer | Michael Niedermayer | 2017-05-16 02:23:18 +0200 |
commit | f08122fbe039a56ab3c24f74636b4b0efea97d85 (patch) | |
tree | 5225a90f7717e900c50d30ec502f1b90ebbb1fc3 /libavcodec/tiff.c | |
parent | 64ad44a3817a288168ba97f6c022160b940cd22e (diff) |
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>
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r-- | libavcodec/tiff.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index c8e24e33cc..680269b096 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1033,6 +1033,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; } } |