mirror of
https://github.com/amitbet/vnc2video.git
synced 2025-09-17 23:39:06 +00:00
Fix paletteSize value overflow when uint8 colorCount value is 255.
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"image/draw"
|
||||
"image/jpeg"
|
||||
"io"
|
||||
|
||||
"github.com/amitbet/vnc2video/logger"
|
||||
)
|
||||
|
||||
@@ -532,7 +533,7 @@ func (enc *TightEncoding) readTightPalette(connReader Conn, bytesPixel int) (col
|
||||
return nil, err
|
||||
}
|
||||
|
||||
paletteSize := colorCount + 1 // add one more
|
||||
paletteSize := int(colorCount) + 1 // add one more
|
||||
//logger.Tracef("----PALETTE_FILTER: paletteSize=%d bytesPixel=%d\n", paletteSize, bytesPixel)
|
||||
//complete palette
|
||||
paletteColorBytes, err := ReadBytes(int(paletteSize)*bytesPixel, connReader)
|
||||
|
Reference in New Issue
Block a user