Commit 5cd57e87 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000dec: check sample sepration for validity

Fixes division by 0
Fixes Ticket2841
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e4eab2d9
......@@ -273,6 +273,10 @@ static int get_siz(Jpeg2000DecoderContext *s)
s->sgnd[i] = !!(x & 0x80);
s->cdx[i] = bytestream2_get_byteu(&s->g);
s->cdy[i] = bytestream2_get_byteu(&s->g);
if (!s->cdx[i] || !s->cdy[i]) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid sample seperation\n");
return AVERROR_INVALIDDATA;
}
log2_chroma_wh |= s->cdy[i] >> 1 << i * 4 | s->cdx[i] >> 1 << i * 4 + 2;
}
......
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