flood_fill_seed: Add assertions
This commit is contained in:
parent
dd6c64cafe
commit
1fa9b0c109
1 changed files with 6 additions and 2 deletions
|
@ -133,11 +133,12 @@ static void flood_fill_line(struct quirc *q, int x, int y,
|
|||
int right;
|
||||
int i;
|
||||
|
||||
row = q->pixels + y * q->w;
|
||||
QUIRC_ASSERT(row[x] == from);
|
||||
|
||||
left = x;
|
||||
right = x;
|
||||
|
||||
row = q->pixels + y * q->w;
|
||||
|
||||
while (left > 0 && row[left - 1] == from)
|
||||
left--;
|
||||
|
||||
|
@ -163,6 +164,9 @@ static void flood_fill_seed(struct quirc *q,
|
|||
const struct quirc_flood_fill_vars *const last_vars =
|
||||
&stack[stack_size - 1];
|
||||
|
||||
QUIRC_ASSERT(from != to);
|
||||
QUIRC_ASSERT(q->pixels[y0 * q->w + x0] == from);
|
||||
|
||||
struct quirc_flood_fill_vars *vars;
|
||||
struct quirc_flood_fill_vars *next_vars;
|
||||
int i;
|
||||
|
|
Loading…
Reference in a new issue