Skip to content

Commit

Permalink
index fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oguyon committed Aug 16, 2024
1 parent bb37932 commit ef86979
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/COREMOD_arith/image_multicrop2D.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,33 +424,31 @@ static errno_t compute_function()
{
if ( *wactive[cropwindow] == 1)
{
uint32_t jjmax = *wcropysize[cropwindow];
if ( jjmax + *wcropystart[cropwindow] > (*outysize))
uint32_t iimax = *wcropxsize[cropwindow];
if ( iimax + *wcropxpos[cropwindow] > (*outxsize))
{
jjmax = (*outysize) - *wcropystart[cropwindow];
iimax = (*outxsize) - *wcropxpos[cropwindow];
}

if ( jjmax + *wcropypos[cropwindow] > imgin.md->size[1])
if ( iimax + *wcropxstart[cropwindow] > imgin.md->size[0])
{
jjmax = imgin.md->size[1] - *wcropypos[cropwindow];
iimax = imgin.md->size[0] - *wcropxstart[cropwindow];
}



uint32_t iimax = *wcropxsize[cropwindow];
if ( iimax + *wcropxpos[cropwindow] > (*outxsize))
uint32_t jjmax = *wcropysize[cropwindow];
if ( jjmax + *wcropypos[cropwindow] > (*outysize))
{
iimax = (*outxsize) - *wcropxpos[cropwindow];
jjmax = (*outysize) - *wcropypos[cropwindow];
}

if ( iimax + *wcropxstart[cropwindow] > imgin.md->size[0])
if ( jjmax + *wcropystart[cropwindow] > imgin.md->size[1])
{
iimax = imgin.md->size[0] - *wcropxstart[cropwindow];
jjmax = imgin.md->size[1] - *wcropystart[cropwindow];
}




for(uint32_t jj = 0; jj < jjmax; jj++)
{
uint64_t indjj = jj + (*wcropystart[cropwindow]);
Expand Down

0 comments on commit ef86979

Please sign in to comment.