test_neighbours: fix warnings in static analyzer.

Coverity complains that a negative value of best_v might be passed to
record_qr_grid().

Fix supplied by Harald Eilertsen (http://github.com/snake66/).
This commit is contained in:
Daniel Beer 2013-02-02 18:07:22 +13:00
parent c8b1861b8f
commit 8d0eb68255

View file

@ -1011,7 +1011,7 @@ static void test_neighbours(struct quirc *q, int i,
}
}
if (best_h < 0)
if (best_h < 0 || best_v < 0)
return;
record_qr_grid(q, best_h, i, best_v);