mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
tiff: check bppcount
Fixes division by 0 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
633f997479
commit
a34418c28e
@ -750,6 +750,11 @@ static int tiff_decode_tag(TiffContext *s)
|
|||||||
"Samples per pixel requires a single value, many provided\n");
|
"Samples per pixel requires a single value, many provided\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
if (value > 4U) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
|
"Samples per pixel %d is too large\n", value);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
if (s->bppcount == 1)
|
if (s->bppcount == 1)
|
||||||
s->bpp *= value;
|
s->bpp *= value;
|
||||||
s->bppcount = value;
|
s->bppcount = value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user