Commit 37a970bb authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '5650e331'

* commit '5650e331':
  jpeg2000: Validate resolution levels

Conflicts:
	libavcodec/jpeg2000dec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents b2498dcf 5650e331
......@@ -266,7 +266,9 @@ static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c)
if (bytestream2_get_bytes_left(&s->g) < 5)
return AVERROR(EINVAL);
c->nreslevels = bytestream2_get_byteu(&s->g) + 1; // num of resolution levels - 1
/* nreslevels = number of resolution levels
= number of decomposition level +1 */
c->nreslevels = bytestream2_get_byteu(&s->g) + 1;
if (c->nreslevels >= JPEG2000_MAX_RESLEVELS) {
av_log(s->avctx, AV_LOG_ERROR, "nreslevels %d is invalid\n", c->nreslevels);
return AVERROR_INVALIDDATA;
......
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