From: Pierre Ossman Date: Fri, 30 Aug 2024 14:15:09 +0000 (+0200) Subject: Correctly handle ZRLE cursors X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6d9017eeb364491cf2acdf1c7e61aee8dd198527;p=tigervnc.git Correctly handle ZRLE cursors Cursor data has a depth of 32 bits and hence cannot use CPIXELs. This is a regression from baca73d. --- diff --git a/common/rfb/ZRLEDecoder.cxx b/common/rfb/ZRLEDecoder.cxx index 474fd6ca..e274a697 100644 --- a/common/rfb/ZRLEDecoder.cxx +++ b/common/rfb/ZRLEDecoder.cxx @@ -125,10 +125,10 @@ void ZRLEDecoder::zrleDecode(const Rect& r, rdr::InStream* is, Pixel maxPixel = pf.pixelFromRGB((uint16_t)-1, (uint16_t)-1, (uint16_t)-1); bool fitsInLS3Bytes = maxPixel < (1<<24); bool fitsInMS3Bytes = (maxPixel & 0xff) == 0; - bool isLowCPixel = (sizeof(T) == 4) && + bool isLowCPixel = (sizeof(T) == 4) && (pf.depth <= 24) && ((fitsInLS3Bytes && pf.isLittleEndian()) || (fitsInMS3Bytes && pf.isBigEndian())); - bool isHighCPixel = (sizeof(T) == 4) && + bool isHighCPixel = (sizeof(T) == 4) && (pf.depth <= 24) && ((fitsInLS3Bytes && pf.isBigEndian()) || (fitsInMS3Bytes && pf.isLittleEndian()));