Skip to content

Commit

Permalink
avcodec/tiff: Check stride for dng
Browse files Browse the repository at this point in the history
Fixes: assertion failure
Fixes: 23422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5746026064642048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 276dfa9)
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Jun 15, 2020
1 parent 716b5c6 commit 8e12af2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libavcodec/tiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,9 @@ static int tiff_unpack_strip(TiffContext *s, AVFrame *p, uint8_t *dst, int strid
return 0;
}

if (is_dng && stride == 0)
return AVERROR_INVALIDDATA;

for (line = 0; line < lines; line++) {
if (src - ssrc > size) {
av_log(s->avctx, AV_LOG_ERROR, "Source data overread\n");
Expand Down

0 comments on commit 8e12af2

Please sign in to comment.