Skip to content

Commit 4bbcb13

Browse files
wind0204iseahound
authored andcommitted
The prev. commit had a bug of the possibility of reaching off haystack
1 parent 559e91d commit 4bbcb13

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

source/imagesearch2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ unsigned int imagesearch2(unsigned int * restrict result, unsigned int * start,
7171

7272
// Start the search.
7373
unsigned int left = 0;
74-
while ( current <= end ) {
74+
while ( current < end ) {
7575

7676
unsigned int offset = current - start;
7777
//unsigned int left = offset % width;

source/imagesearchall2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ unsigned int imagesearchall2(unsigned int * restrict result, unsigned int capaci
7070

7171
// Start the search.
7272
unsigned int left = 0;
73-
while ( current <= end ) {
73+
while ( current < end ) {
7474

7575
unsigned int offset = current - start;
7676
//unsigned int left = offset % width;

0 commit comments

Comments
 (0)