Commit ae5e1f3d authored by Anton Khirnov's avatar Anton Khirnov Committed by Luca Barbato

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
Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
parent 6448f15a
......@@ -252,6 +252,14 @@ static int init_image(TiffContext *s, AVFrame *frame)
{
int ret;
// 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->planar * 1000 + s->bpp * 10 + s->bppcount) {
case 11:
s->avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment