提交 282bb028 编写于 作者: M Michael Niedermayer

j2kdec: Fix crash in get_qcx

Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 3eedf9f7
......@@ -365,7 +365,7 @@ static int get_qcx(J2kDecoderContext *s, int n, J2kQuantStyle *q)
if (q->quantsty == J2K_QSTY_NONE){
n -= 3;
if (s->buf_end - s->buf < n)
if (s->buf_end - s->buf < n || 32*3 < n)
return AVERROR(EINVAL);
for (i = 0; i < n; i++)
q->expn[i] = bytestream_get_byte(&s->buf) >> 3;
......@@ -382,7 +382,7 @@ static int get_qcx(J2kDecoderContext *s, int n, J2kQuantStyle *q)
}
} else{
n = (n - 3) >> 1;
if (s->buf_end - s->buf < n)
if (s->buf_end - s->buf < n || 32*3 < n)
return AVERROR(EINVAL);
for (i = 0; i < n; i++){
x = bytestream_get_be16(&s->buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册