mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-03 19:18:01 +00:00
avcodec/tiff: Check stripsize strippos for overflow
Fixes: 861/clusterfuzz-testcase-5688284384591872
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5d996b5649
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
6652799267
commit
a7ccd87090
@ -905,6 +905,11 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
|
|||||||
break;
|
break;
|
||||||
case TIFF_STRIP_OFFS:
|
case TIFF_STRIP_OFFS:
|
||||||
if (count == 1) {
|
if (count == 1) {
|
||||||
|
if (value > INT_MAX) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
|
"strippos %u too large\n", value);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
s->strippos = 0;
|
s->strippos = 0;
|
||||||
s->stripoff = value;
|
s->stripoff = value;
|
||||||
} else
|
} else
|
||||||
@ -916,6 +921,11 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
|
|||||||
break;
|
break;
|
||||||
case TIFF_STRIP_SIZE:
|
case TIFF_STRIP_SIZE:
|
||||||
if (count == 1) {
|
if (count == 1) {
|
||||||
|
if (value > INT_MAX) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
|
"stripsize %u too large\n", value);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
s->stripsizesoff = 0;
|
s->stripsizesoff = 0;
|
||||||
s->stripsize = value;
|
s->stripsize = value;
|
||||||
s->strips = 1;
|
s->strips = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user