// update precincts size: 2^n value
reslevel->log2_prec_width = codsty->log2_prec_widths[reslevelno];
reslevel->log2_prec_height = codsty->log2_prec_heights[reslevelno];
- if (!reslevel->log2_prec_width || !reslevel->log2_prec_height) {
- return AVERROR_INVALIDDATA;
- }
/* Number of bands for each resolution level */
if (reslevelno == 0)
uint8_t prog_order; // progression order
uint8_t log2_prec_widths[JPEG2000_MAX_RESLEVELS]; // precincts size according resolution levels
uint8_t log2_prec_heights[JPEG2000_MAX_RESLEVELS]; // TODO: initialize prec_size array with 0?
+ uint8_t init;
} Jpeg2000CodingStyle;
typedef struct Jpeg2000QuantStyle {
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));
return ret;
properties[compno] |= HAD_COC;
+ c->init = 1;
return 0;
}
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))