From 39dfcba9e342f10dfa8c7b8cb61d7f1faf9fc29a Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sat, 22 Apr 2023 15:29:33 +0200 Subject: [PATCH] LUT: disable when running on big-endian systems We are crashing due to endian assumptions - we now only try to do the LUT optimizations on little endian - no functionality is lost on big-endian though conversion might be a tad slower. Hopefully fixing issue #91 --- babl/babl-fish-path.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index c01cc2d..ef195f8 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -648,6 +648,14 @@ _babl_legal_error (void) else enable_lut = 1; + { + const uint32_t u32 = 1; + if ( *((char*)&u32) == 0) + { /* disable use of LUTs if we are running on big endian */ + enable_lut = 0; + } + } + return error; } -- 2.30.2