aboutsummaryrefslogtreecommitdiffstats
path: root/liblss16_optimise.c
diff options
context:
space:
mode:
Diffstat (limited to 'liblss16_optimise.c')
-rw-r--r--liblss16_optimise.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/liblss16_optimise.c b/liblss16_optimise.c
index 5e69d85..f532a94 100644
--- a/liblss16_optimise.c
+++ b/liblss16_optimise.c
@@ -2,6 +2,10 @@
#include "liblss16.h"
#include <string.h>
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
+#endif
+
void
liblss16_optimise(struct liblss16_header *header, uint8_t *pixels)
@@ -37,6 +41,10 @@ liblss16_optimise(struct liblss16_header *header, uint8_t *pixels)
width = (unsigned)header->width;
width = width < 17U ? width : 17U;
for (y = 0, p = 0; y < (unsigned)header->height; y++) {
+#ifdef HARDEN
+ for (x = 0; x < (unsigned)header->width; x++)
+ pixels[p + x] &= 15U;
+#endif
colour = remap[pixels[p]];
count = 1U;
for (x = 1U; x < width; x++, p++) {