Browse Source

tiff: check bppcount

Fixes division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.2
Michael Niedermayer 13 years ago
parent
commit
a34418c28e
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/tiff.c

+ 5
- 0
libavcodec/tiff.c View File

@@ -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;


Loading…
Cancel
Save