diff options
| author | Michael Niedermayer <[email protected]> | 2017-05-15 21:19:06 +0200 |
|---|---|---|
| committer | Michael Niedermayer <[email protected]> | 2017-05-17 20:35:20 +0200 |
| commit | 55d320ddf850fc720720825cc7cee72b866c8cd7 (patch) | |
| tree | 3aab7fa4a09a6244c23f148b1d6556a19cde0f5b | |
| parent | ec7206fdf801cec037f18a16d89ff37be48a8945 (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 <[email protected]>
(cherry picked from commit f08122fbe039a56ab3c24f74636b4b0efea97d85)
Signed-off-by: Michael Niedermayer <[email protected]>
| -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 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; } } |
