[FFmpeg-cvslog] avcodec/tiff: reset sampling[] if its invalid

Michael Niedermayer git at videolan.org
Tue May 16 04:53:11 EEST 2017


ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Mon May 15 21:19:06 2017 +0200| [c521f9a5cd8cabaf985eb06f87e9b7f7ad5fcaf2] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit f08122fbe039a56ab3c24f74636b4b0efea97d85)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c521f9a5cd8cabaf985eb06f87e9b7f7ad5fcaf2
---

 libavcodec/tiff.c | 1 +
 1 file changed, 1 insertion(+)

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;
             }
         }



More information about the ffmpeg-cvslog mailing list