diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-03 11:20:39 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-03 11:20:39 +0200 |
commit | 37a970bbb668956956c632652a4316cceb48955a (patch) | |
tree | 5e060b0057dc9ca87abbeeb39b3b08bd58cb9abb /libavcodec | |
parent | b2498dcf5ca9473da4a63aebec9765e410f13dbb (diff) | |
parent | 5650e331a733711b809bc27f968500f0f5530126 (diff) | |
download | ffmpeg-37a970bbb668956956c632652a4316cceb48955a.tar.gz |
Merge commit '5650e331a733711b809bc27f968500f0f5530126'
* commit '5650e331a733711b809bc27f968500f0f5530126':
jpeg2000: Validate resolution levels
Conflicts:
libavcodec/jpeg2000dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/jpeg2000dec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index f449b585df..043ec03a2e 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -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; |