diff --git a/libvips/mosaicing/im_lrmerge.c b/libvips/mosaicing/im_lrmerge.c index f36dee40..cdb012cc 100644 --- a/libvips/mosaicing/im_lrmerge.c +++ b/libvips/mosaicing/im_lrmerge.c @@ -392,7 +392,7 @@ make_firstlast( MergeInfo *inf, Overlapping *ovlap, Rect *oreg ) int ii; \ \ for( ii = 0; ii < cb; ii++ ) \ - if( tt[ii] ) \ + if( tt[i + ii] ) \ break; \ if( ii == cb ) \ (RESULT) = 1; \ diff --git a/libvips/mosaicing/im_tbmerge.c b/libvips/mosaicing/im_tbmerge.c index 26af4ef9..09afb6ff 100644 --- a/libvips/mosaicing/im_tbmerge.c +++ b/libvips/mosaicing/im_tbmerge.c @@ -335,7 +335,7 @@ make_firstlast( MergeInfo *inf, Overlapping *ovlap, Rect *oreg ) int ii; \ \ for( ii = 0; ii < cb; ii++ ) \ - if( tt[ii] ) \ + if( tt[i + ii] ) \ break; \ if( ii == cb ) \ (RESULT) = 1; \