From a870f3cbb9c6e3813c01818826f1ca366b1e8fb8 Mon Sep 17 00:00:00 2001 From: wentianle Date: Fri, 10 Aug 2018 01:42:52 +0800 Subject: [PATCH] fix vncproxy on windows 2008 rfb proto parse bug Uint8 value range out of bounds causes problems in the parsing protocol --- encodings/enc-tight.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encodings/enc-tight.go b/encodings/enc-tight.go index 3cdf925..c1cb881 100644 --- a/encodings/enc-tight.go +++ b/encodings/enc-tight.go @@ -142,7 +142,7 @@ func handleTightFilters(subencoding uint8, pixelFmt *common.PixelFormat, rect *c return } - paletteSize := colorCount + 1 // add one more + paletteSize := int(colorCount) + 1 // add one more logger.Debugf("handleTightFilters: ----PALETTE_FILTER: paletteSize=%d bytesPixel=%d\n", paletteSize, bytesPixel) //complete palette _, err = r.ReadBytes(int(paletteSize) * bytesPixel)