summary refs log tree commit diff
path: root/bin/gfx
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-02-14 22:01:48 -0500
committerJune McEnroe <programble@gmail.com>2018-02-14 22:01:48 -0500
commit29ddcb071ab2344cdfc65489e6f6711b6f8b0d21 (patch)
treeae0256303bc91a7edc28c4b96fa94e360c4e4cce /bin/gfx
parentPrint PNG path on gfxx dump (diff)
downloadsrc-29ddcb071ab2344cdfc65489e6f6711b6f8b0d21.tar.gz
src-29ddcb071ab2344cdfc65489e6f6711b6f8b0d21.zip
Avoid accessing past last byte in gfxx
Diffstat (limited to '')
-rw-r--r--bin/gfxx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/gfxx.c b/bin/gfxx.c
index 674b68c9..6777c668 100644
--- a/bin/gfxx.c
+++ b/bin/gfxx.c
@@ -271,7 +271,7 @@ static void drawBits(struct Iter *it) {
 
 static void drawBytes(struct Iter *it) {
     uint8_t bytes = (BITS_TOTAL + 7) / 8;
-    for (size_t i = offset; i < size; i += bytes) {
+    for (size_t i = offset; i + bytes <= size; i += bytes) {
         uint32_t n = 0;
         for (size_t b = 0; b < bytes; ++b) {
             n <<= 8;