Skip to content

Commit d27dc43

Browse files
committed
Fix regression in TRLE level 0
1 parent 9abcd43 commit d27dc43

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

mac-cpp-source/VNCEncodeTRLE.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ void VNCEncodeTRLE::begin() {
246246
(currentInfo.nColors > 1) &&
247247
(mapColors ? canReuseColorsPalette(&lastInfo, &currentInfo) : (lastInfo.nColors == nativeColors));
248248
if (canReuse) info = &lastInfo;
249+
#else
250+
const Boolean canReuse = false;
249251
#endif
250252

251253
if (currentInfo.nColors > 1) {
@@ -278,7 +280,7 @@ void VNCEncodeTRLE::begin() {
278280
if (currentInfo.nColors <= 4) {
279281
#endif
280282
tileDepth = getDepth(currentInfo.nColors);
281-
const unsigned long bitsPerRow = /*(unsigned short)*/epb.cols * tileDepth;
283+
const unsigned long bitsPerRow = epb.cols * tileDepth;
282284
const unsigned long bytesPerRow = (bitsPerRow + 7) / 8;
283285
const Boolean rowDivisibleByBytes = (bitsPerRow % 8) == 0;
284286
const unsigned long packedTileLen = 1 + (canReuse ? 0 : paletteLen) + bytesPerRow * epb.rows;

0 commit comments

Comments
 (0)