Commit e96c8015 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '1018a922'

* commit '1018a922':
  jpeg2000: Check block length

See: 914ab4cd
See: 582f5334Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 5a7a902a 1018a922
......@@ -791,8 +791,12 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
Jpeg2000Cblk *cblk = prec->cblk + cblkno;
if ( bytestream2_get_bytes_left(&s->g) < cblk->lengthinc
|| sizeof(cblk->data) < cblk->length + cblk->lengthinc + 2
)
) {
av_log(s->avctx, AV_LOG_ERROR,
"Block length %d or lengthinc %d is too large\n",
cblk->length, cblk->lengthinc);
return AVERROR_INVALIDDATA;
}
bytestream2_get_bufferu(&s->g, cblk->data + cblk->length, cblk->lengthinc);
cblk->length += cblk->lengthinc;
......
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