Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash frequently while connect to UltraVNC. #24

Open
F-Sidney opened this issue Sep 2, 2024 · 0 comments
Open

Crash frequently while connect to UltraVNC. #24

F-Sidney opened this issue Sep 2, 2024 · 0 comments

Comments

@F-Sidney
Copy link

F-Sidney commented Sep 2, 2024

Error logs as this:

[Info ] ----------RECT 20----------[Debug] rect x: 512, y: 793, width: 1408, height: 46, enc: EncTight
[Trace] -----------READ-Tight-encoding compctl=96 -------------
[Trace] ###resetDecoders compctl :0
[Trace] ----readTightPalette: colorCount=255

[Trace] ----PALETTE_FILTER: paletteSize=0 bytesPixel=3

[Trace] ----PALETTE_FILTER,palette len=0 counter=0, rect= rect x: 512, y: 793, width: 1408, height: 46, enc: EncTight
[Trace] got palette: []
[Trace] >>> Reading zipped tight data from decoder Id: 2, openSize: 64768
[Error] handleTightFilters: error in handling tight encoding, reading palette filter data: flate: corrupt input before offset 347728
[Trace] ----End RECT #20 Info (1408x46) encType:EncTight
[Info ] ----------RECT 21----------[Debug] rect x: 49567, y: 24521, width: 64975, height: 28539, enc: EncodingType(-962466125)
[Trace] ============== End Message: type=0 ==============

The problem was caused by the paletteSize overflow when using uint8 and the value is 255,

using following code can fix it.

code file: "encoding_tight.go":

@@ -532,8 +532,10 @@ func (enc *TightEncoding) readTightPalette(connReader Conn, bytesPixel int) (col
 		return nil, err
 	}
 
-	paletteSize := colorCount + 1 // add one more
-	//logger.Tracef("----PALETTE_FILTER: paletteSize=%d bytesPixel=%d\n", paletteSize, bytesPixel)
+	logger.Tracef("----readTightPalette: colorCount=%d \n", colorCount)
+
+	paletteSize := int(colorCount) + 1 // add one more
+	logger.Tracef("----PALETTE_FILTER: paletteSize=%d bytesPixel=%d\n", paletteSize, bytesPixel)
@F-Sidney F-Sidney changed the title Crash freqently while connect to UltraVNC. Crash frequently while connect to UltraVNC. Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant