summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2017-06-22 20:21:05 +0200
committerMichael Niedermayer <[email protected]>2017-06-23 03:05:34 +0200
commit0879ecd4a3571f53628bd06028e6d5efa464aae2 (patch)
tree594e580d0cb475596beb29dba1bb3ace8af5d0cd
parentdf11b45644e0c3067650b3a926aa8b6fc45cafa6 (diff)
avcodec/tiff: Update pointer only when the result is used
Fixes: runtime error: signed integer overflow: 538976288 * 32 cannot be represented in type 'int' Fixes: 2310/clusterfuzz-testcase-minimized-4534784887881728 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 27f80ab0160d2e64007e1c9799ffd4504cc13eb5) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/tiff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index d026a5bd98..fcfa32dc8b 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1288,6 +1288,8 @@ static int decode_frame(AVCodecContext *avctx,
stride = p->linesize[plane];
dst = p->data[plane];
for (i = 0; i < s->height; i += s->rps) {
+ if (i)
+ dst += s->rps * stride;
if (s->stripsizesoff)
ssize = ff_tget(&stripsizes, s->sstype, le);
else
@@ -1308,7 +1310,6 @@ static int decode_frame(AVCodecContext *avctx,
return ret;
break;
}
- dst += s->rps * stride;
}
if (s->predictor == 2) {
if (s->photometric == TIFF_PHOTOMETRIC_YCBCR) {