mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-25 16:21:13 +00:00
tiff: Check that there is no aliasing in pixel format selection
Fixes possible issues with unexpected bpp/bppcount values. CC: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Bug-Id: CVE-2014-8544 (cherry picked from commitae5e1f3d66
) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> (cherry picked from commiteb9041403d
) Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commit62b0462e5f
) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
parent
82776caf79
commit
ec5b2f6a38
@ -218,6 +218,14 @@ static int init_image(TiffContext *s)
|
||||
int i, ret;
|
||||
uint32_t *pal;
|
||||
|
||||
// make sure there is no aliasing in the following switch
|
||||
if (s->bpp >= 100 || s->bppcount >= 10) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"Unsupported image parameters: bpp=%d, bppcount=%d\n",
|
||||
s->bpp, s->bppcount);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
switch (s->bpp * 10 + s->bppcount) {
|
||||
case 11:
|
||||
s->avctx->pix_fmt = PIX_FMT_MONOBLACK;
|
||||
|
Loading…
Reference in New Issue
Block a user