diff options
author | Gautam Ramakrishnan <gautamramk@gmail.com> | 2020-06-29 23:29:06 +0530 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-06-30 20:35:23 +0200 |
commit | 579ac96a0422be18a10277aa6e8dd26207dc4d40 (patch) | |
tree | 14fbe56818d4982d2afc7ea9710a58f8c2bb0bf1 /libavcodec/jpeg2000dec.c | |
parent | 9aef4ae97599c61845ed76d37e81e5a8c4b266ff (diff) |
libavcodec/jpeg2000.c: Precinct size check removed
This patch removes a check which throws an error if
the log2 precinct width/height is 0. The standard allows
the first component to have 0 as the log2 width/height.
However, to ensure proper intialization of coding style,
an extra check has been added.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/jpeg2000dec.c')
-rw-r--r-- | libavcodec/jpeg2000dec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 546a646668..3f4a9ef96c 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -567,7 +567,7 @@ static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c, if ((ret = get_cox(s, &tmp)) < 0) return ret; - + tmp.init = 1; for (compno = 0; compno < s->ncomponents; compno++) if (!(properties[compno] & HAD_COC)) memcpy(c + compno, &tmp, sizeof(tmp)); @@ -605,6 +605,7 @@ static int get_coc(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c, return ret; properties[compno] |= HAD_COC; + c->init = 1; return 0; } @@ -991,7 +992,8 @@ static int init_tile(Jpeg2000DecoderContext *s, int tileno) if (!comp->roi_shift) comp->roi_shift = s->roi_shift[compno]; - + if (!codsty->init) + return AVERROR_INVALIDDATA; if (ret = ff_jpeg2000_init_component(comp, codsty, qntsty, s->cbps[compno], s->cdx[compno], s->cdy[compno], s->avctx)) |