Commit 70dba1e3 authored by Michael Niedermayer's avatar Michael Niedermayer

kvmc: Check palsize.

Fixes: CVE-2011-3952

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1860c66c
......@@ -380,6 +380,11 @@ static av_cold int decode_init(AVCodecContext * avctx)
c->palsize = 127;
} else {
c->palsize = AV_RL16(avctx->extradata + 10);
if (c->palsize > 255U) {
c->palsize = 127;
av_log(NULL, AV_LOG_ERROR, "palsize too big\n");
return -1;
}
}
if (avctx->extradata_size == 1036) { // palette in 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