From 878342e3923db77ece4fc3244ff530ce03e7bc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Sat, 11 Jan 2025 04:36:08 -0500 Subject: [PATCH] Add missing unlock, and silence Coverity warning. --- src/conio/bitmap_con.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/conio/bitmap_con.c b/src/conio/bitmap_con.c index d18c83a3c4..d4d8b3a752 100644 --- a/src/conio/bitmap_con.c +++ b/src/conio/bitmap_con.c @@ -671,7 +671,8 @@ draw_char_row(struct blockstate *bs, struct charstate *cs, uint32_t y) for(unsigned x = 0; x < vstat.charwidth; x++) { unsigned bitnum = x & 0x07; if (bs->expand && x == bs->font_data_width) { - if (cs->gexpand) + // The comparison with x is to silence Coverity false-positive. + if (cs->gexpand && x) fbb = cs->font[cs->fontoffset - 1] & (0x80 >> ((x - 1) & 7)); else fbb = 0; @@ -1764,6 +1765,7 @@ int bitmap_setpixels(uint32_t sx, uint32_t sy, uint32_t ex, uint32_t ey, uint32_ pthread_mutex_lock(&screenlock); if (ex > screena.screenwidth || ey > screena.screenheight) { pthread_mutex_unlock(&screenlock); + pthread_mutex_unlock(&vstatlock); return 0; } -- GitLab