cblk->lblock = 3;
cblk->length = 0;
- memset(cblk->lengthinc, 0, sizeof(cblk->lengthinc));
cblk->npasses = 0;
}
if (!reslevel->band)
return AVERROR(ENOMEM);
+ if (reslevel->num_precincts_x * (uint64_t)reslevel->num_precincts_y * reslevel->nbands > avctx->max_pixels / sizeof(*reslevel->band->prec))
+ return AVERROR(ENOMEM);
+
for (bandno = 0; bandno < reslevel->nbands; bandno++, gbandno++) {
ret = init_band(avctx, reslevel,
comp, codsty, qntsty,
for (cblkno = 0; cblkno < nb_code_blocks; cblkno ++) {
Jpeg2000Cblk *cblk = &prec->cblk[cblkno];
av_freep(&cblk->data);
+ av_freep(&cblk->passes);
+ av_freep(&cblk->lengthinc);
+ av_freep(&cblk->data_start);
}
av_freep(&prec->cblk);
}