Skip to content

Uninitialized variable #629

Closed
Closed
@maddin200

Description

src\lib\openjp3d\jp3d.c line 1018 Uninitialized variable: numbands

Code:
int bandno, numbands;
int expn, mant;

opj_cp_t *cp = j3d->cp;
opj_tcp_t *tcp = &cp->tcps[j3d->curtileno];
opj_tccp_t *tccp = &tcp->tccps[compno];
opj_cio_t *cio = j3d->cio;

cio_write(cio, tccp->qntsty + (tccp->numgbits << 5), 1);    /* Sqcx : Table A28 de 15444-1*/

if (j3d->cinfo->codec_format == CODEC_J2K)
    numbands = tccp->qntsty == J3D_CCP_QNTSTY_SIQNT ? 1 : tccp->numresolution[0] * 3 - 2; 
else if (j3d->cinfo->codec_format == CODEC_J3D) {
    int diff = tccp->numresolution[0] - tccp->numresolution[2];
    numbands = (tccp->qntsty == J3D_CCP_QNTSTY_SIQNT) ? 1 : (tccp->numresolution[0] * 7 - 6) - 4 *diff; /* SIQNT vs. SEQNT */
}

for (bandno = 0; bandno < numbands; bandno++) {

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions