From a62bd9282e8cebe4e34c1930da04670695f8974b Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 22 Dec 2013 20:15:03 +0100 Subject: Fix warning and re-order code a bit. Change-Id: I1d733b3d0bd17cc541218f9a2b7712712ad314dd --- apps/recorder/bmp.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'apps/recorder/bmp.c') diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index 75d82b449f..58393bfc11 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c @@ -718,11 +718,11 @@ int read_bmp_fd(int fd, case 32: if (compression == 3) { /* BI_BITFIELDS */ - bool found; + bool found = false; int i, j; /* (i == 0) is 15bit, (i == 1) is 16bit, (i == 2) is 32bit */ - for (i = 0; i < ARRAY_SIZE(bitfields); i++) { + for (i = 0; i < ARRAY_SIZE(bitfields) && !found; i++) { /* for 15bpp and higher numcolors has the number of color masks */ for (j = 0; j < numcolors; j++) { if (!rgbcmp(&palette[j], &bitfields[i][j])) { @@ -732,16 +732,13 @@ int read_bmp_fd(int fd, break; } } - if (found) { - if (i == 0) /* 15bit */ - depth = 15; - else if (i == 3) /* 32bit, ABGR bitmap */ - order = ABGR; - break; - } } - if (found) - break; + if (found) { + if (i == 0) /* 15bit */ + depth = 15; + else if (i == 3) /* 32bit, ABGR bitmap */ + order = ABGR; + } } /* else fall through */ default: -- cgit v1.2.3