From cae4b8ed522c0302dd4db994ffcf509f0a245535 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Wed, 11 Apr 2012 11:54:59 +0200 Subject: roi: Leave comparision loop early if false --- roi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit