From e114123df2a05650f0f7e34044c1e8f829c50a44 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 3 Mar 2025 16:43:19 +0100 Subject: misc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- liblss16_encode_from_colour_index.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'liblss16_encode_from_colour_index.c') diff --git a/liblss16_encode_from_colour_index.c b/liblss16_encode_from_colour_index.c index 1efff36..95b600b 100644 --- a/liblss16_encode_from_colour_index.c +++ b/liblss16_encode_from_colour_index.c @@ -1,7 +1,12 @@ /* See LICENSE file for copyright and license details. */ #include "liblss16.h" -#include #include +#include + +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wimplicit-fallthrough" +# pragma clang diagnostic ignored "-Wunsafe-buffer-usage" +#endif static size_t @@ -16,9 +21,8 @@ flush_buffer(struct liblss16_encoder *encoder, uint8_t *buffer, size_t size) enum liblss16_encode_state -liblss16_encode_from_colour_index(struct liblss16_encoder *encoder, void *buffer_, size_t size, - size_t *written_out, const uint8_t *pixels, size_t npixels, - size_t *nconsumed_out, enum liblss16_encode_error *error_out) +liblss16_encode_from_colour_index(struct liblss16_encoder *encoder, void *buffer_, size_t size, size_t *written_out, + const uint8_t *pixels, size_t npixels, size_t *nconsumed_out) { uint8_t *buffer = buffer_; size_t n; @@ -120,10 +124,6 @@ liblss16_encode_from_colour_index(struct liblss16_encoder *encoder, void *buffer while (npixels--) { if (*pixels == encoder->previous) { encoder->repetition++; - } else if (*pixels > 15U) { - if (error_out) - *error_out = LIBLSS16_ENCODE_BAD_COLOUR_INDEX; - return LIBLSS16_ENCODE_ERROR; } else { if (!encoder->repetition) { /* do nothing */ -- cgit v1.2.3-70-g09d2