summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-04-11 11:54:59 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-04-11 11:54:59 +0200
commitcae4b8ed522c0302dd4db994ffcf509f0a245535 (patch)
tree7f19a793843b0b4e395b1aee9c4dcdfc65f608be
parent483a31793ec45f73a58e9bdbc3060e9e698cb8e4 (diff)
downloadcv-cae4b8ed522c0302dd4db994ffcf509f0a245535.zip
cv-cae4b8ed522c0302dd4db994ffcf509f0a245535.tar.gz
cv-cae4b8ed522c0302dd4db994ffcf509f0a245535.tar.bz2
roi: Leave comparision loop early if false
-rw-r--r--roi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/roi.c b/roi.c
index 0b2e372..31b6eb0 100644
--- a/roi.c
+++ b/roi.c
@@ -95,7 +95,7 @@ mark_matching_pixels(struct roi *roi, GdkPixbuf *image)
for (y = 0; y < height; ++y, row += stride) {
for (x = 0, p = row; x < width; ++x, p += nch) {
gboolean H = TRUE;
- for (i = 0; i < 3; ++i) {
+ for (i = 0; i < 3 && H; ++i) {
if (!(p[i] >= roi->interval[i].min &&
p[i] <= roi->interval[i].max))
H = FALSE;