Skip to content

Commit

Permalink
Correctly handle ZRLE cursors
Browse files Browse the repository at this point in the history
Cursor data has a depth of 32 bits and hence cannot use CPIXELs.

This is a regression from baca73d.
  • Loading branch information
CendioOssman committed Aug 30, 2024
1 parent 49a087e commit 6d9017e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/rfb/ZRLEDecoder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand Down

0 comments on commit 6d9017e

Please sign in to comment.