From: Øyvind Kolås Date: Sat, 22 Apr 2023 13:29:33 +0000 (+0200) Subject: LUT: disable when running on big-endian systems X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=39dfcba9e342f10dfa8c7b8cb61d7f1faf9fc29a;p=babl.git 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 --- 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; }