Opened 8 years ago

Closed 8 years ago

#6425 closed defect (fixed)

Possible bug in GTiffJPEGOverviewBand ctor

Reported by: Kurt Schwehr Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

If nBlockYSize is 1, set it to 1? Added in r27234.

GTiffJPEGOverviewBand::GTiffJPEGOverviewBand(GTiffJPEGOverviewDS* poDSIn, int nBandIn)
{
    poDS = poDSIn;
    nBand = nBandIn;
    eDataType = poDSIn->poParentDS->GetRasterBand(nBandIn)->GetRasterDataType();
    poDSIn->poParentDS->GetRasterBand(nBandIn)->GetBlockSize(&nBlockXSize, &nBlockYSize);
    const int nScaleFactor = 1 << poDSIn->nOverviewLevel;
    nBlockXSize = (nBlockXSize + nScaleFactor - 1) / nScaleFactor;
    if( nBlockYSize == 1 )  // BUG?
        nBlockYSize = 1;    // BUG?
    else
        nBlockYSize = (nBlockYSize + nScaleFactor - 1) / nScaleFactor;
}

Change History (1)

comment:1 by Even Rouault, 8 years ago

Resolution: fixed
Status: newclosed

AFAICS the code was OK, but that case was actually redundant with the general case.

trunk r33787 "GTiff: simplify logic in GTiffJPEGOverviewBand::GTiffJPEGOverviewBand() (#6425)"

Note: See TracTickets for help on using tickets.