IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 17, 2009, 3:56:04 PM (17 years ago)
Author:
bills
Message:

range check the source coordinates before dereferencing the mask image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksremove.c

    r25209 r25434  
    864864            psF32 y = psMetadataLookupF32(NULL, row, "Y_PSF");
    865865
    866             psImageMaskType mask = maskImage->data.PS_TYPE_IMAGE_MASK_DATA[(int)y][(int)x];
     866            psImageMaskType mask;
     867            if ((x >= maskImage->numCols) || (y >= maskImage->numRows) || (x <  0) || (y < 0)) {
     868                mask = maskStreak;
     869            } else {
     870                mask = maskImage->data.PS_TYPE_IMAGE_MASK_DATA[(int)y][(int)x];
     871            }
    867872
    868873            // Key the source if the center pixel is not masked with maskStreak
Note: See TracChangeset for help on using the changeset viewer.