提交 2884cf20 编写于 作者: A Andreas Cadhalpun 提交者: Anton Khirnov

on2avc: limit number of bits to 30 in get_egolomb

More don't fit into the integer output.

Also use get_bits_long, since get_bits only supports reading up to 25
bits, while get_bits_long supports the full integer range.
Signed-off-by: NAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: NAnton Khirnov <anton@khirnov.net>
上级 c59fec78
......@@ -211,9 +211,16 @@ static inline int get_egolomb(GetBitContext *gb)
{
int v = 4;
while (get_bits1(gb)) v++;
while (get_bits1(gb)) {
v++;
if (v > 30) {
av_log(NULL, AV_LOG_WARNING, "Too large golomb code in get_egolomb.\n");
v = 30;
break;
}
}
return (1 << v) + get_bits(gb, v);
return (1 << v) + get_bits_long(gb, v);
}
static int on2avc_decode_pairs(On2AVCContext *c, GetBitContext *gb, float *dst,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册