Commit 50c449ac authored by Kostya Shishkov's avatar Kostya Shishkov Committed by Luca Barbato

iff: validate CMAP palette size

Fixes CVE-2013-2495

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>

CC: libav-stable@libav.org
parent d1bec33b
......@@ -166,6 +166,11 @@ static int iff_read_header(AVFormatContext *s)
break;
case ID_CMAP:
if (data_size < 3 || data_size > 768 || data_size % 3) {
av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %d\n",
data_size);
return AVERROR_INVALIDDATA;
}
st->codec->extradata_size = data_size;
st->codec->extradata = av_malloc(data_size);
if (!st->codec->extradata)
......
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