[syslinux] [PATCH 2/2] core/graphics: fix lss16 parsing

Patrick Masotta masottaus at yahoo.com
Sat Aug 22 00:56:46 PDT 2015


>>>> 
 getnybble() needs to
 return four bits at a time from every byte.
 During rle decode, rows are rounded to an
 integer number of bytes.
 The rle length
 needs to be able to hold values > 255.
 
 Signed-off-by: Chas Williams
 <3chas3 at gmail.com>
 <<<<

I think this change is also already included in the patch quoted previously by Ady
http://www.syslinux.org/archives/2015-July/023835.html 


-static inline char getnybble(void)
+static inline char getnybble(uint8_t* last_nybble)
 {
-       char data = getc(fd);
 
-       if (data & 0x10) {
-               data &= 0x0F;
-               return data;
-       }
+       char data;
+
+       if (*last_nybble & 0x10) 
+               {
+                       *last_nybble &= 0x0F;
+                       return *last_nybble;
+               }
 
        data = getc(fd);
+
+       *last_nybble= (data >>4) | 0x10; //Flag nibble already read
+               
        return (data & 0x0F);
 }



Please take a moment and see what the quoted code does; it'll save you lot of time.

Best,
Patrick





More information about the Syslinux mailing list