summaryrefslogtreecommitdiff
path: root/libavcodec/tiff.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-19 17:48:56 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-19 17:57:36 +0100
commita34418c28e0accd1468ca15fff4d4f138a609f4e (patch)
tree74cb7226b8c4ca6a797541739ac1e021503d0a9c /libavcodec/tiff.c
parent633f9974790e2c0cff6ffafddc1ce0224fb08329 (diff)
tiff: check bppcount
Fixes division by 0 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r--libavcodec/tiff.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 939cfb2dca..77706c0cda 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -750,6 +750,11 @@ static int tiff_decode_tag(TiffContext *s)
"Samples per pixel requires a single value, many provided\n");
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)
s->bpp *= value;
s->bppcount = value;