﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
724	Loop in RasterScan to TileScan lacks an early exit	pieterkapsenberg	bbross	"In '''6.5.1 Coding tree block raster and tile scanning conversion process''', the derivation process for ctbAddrRStoTS is lacking an exit out of the loop when determining tileX and tileY. As a result, tileX and tileY always end up with the maximum value. Since there is no defined way of early exit (no equivalent to the C ""break""), this can be solved by running the loop backward like so:

{{{
for( i = num_tile_columns_minus1; i >= 0; i-- )
    if( tbX >= colBd[ i ] )
        tileX = i
}}}
Alternatively:

{{{
    tileX = -1
    for( i = 0; i <= num_tile_columns_minus1; i++ )
        if( ( tileX < 0 ) && ( tbX >= colBd[ i ] ) )
            tileX = i

}}}
"	defect	closed	minor	D8	Text	D8 (J1003) d7	invalid		bbross wjhan jct-vc@…
