summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-07-21 14:42:32 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-07-21 14:43:24 -0700
commit8dee1b3a8008202810e18c06bf78b3b05409ffaf (patch)
treeed1171ee416f5183039e2c6f66f70582fe416d42
parentdaba8411d9a658f0fec116f36550652aa7dfabe9 (diff)
bdfReadBitmap: avoid access to byte before start of array
Clears 4 -Wanalyzer-out-of-bounds warnings from gcc 14.1 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/util/bdftopcf/-/merge_requests/7>
-rw-r--r--bdfread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bdfread.c b/bdfread.c
index feaf15c..c1e5d06 100644
--- a/bdfread.c
+++ b/bdfread.c
@@ -152,7 +152,7 @@ bdfReadBitmap(CharInfoPtr pCI, FontFilePtr file, int bit, int byte,
for (i = widthHexChars - inLineLen; i > 0; i--)
picture[nextByte++] = 0;
}
- else {
+ else if (nextByte > 0) {
unsigned char mask;
mask = 0xff << (8 - (widthBits & 0x7));