From 6b3575cd59b54fca37408fff564bfbcfed42556c Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 11 May 2021 15:03:09 +0900 Subject: [PATCH] flood_fill_seed: Add comments on exit conditions --- lib/identify.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/identify.c b/lib/identify.c index b6993f7..44fa48d 100644 --- a/lib/identify.c +++ b/lib/identify.c @@ -234,6 +234,13 @@ static void flood_fill_seed(struct quirc *q, quirc_pixel_t *row; if (vars == last_vars) { + /* + * "Stack overflow". + * Just stop and return. + * This can be caused by very complex shapes in + * the image, which is not likely a part of + * a valid QR code anyway. + */ break; } @@ -268,6 +275,7 @@ static void flood_fill_seed(struct quirc *q, continue; } + /* We've done. */ break; } }