Mercurial > hg > Applications > TreeVNC
changeset 579:5bc128c8e6aa
fix offset
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 07 Feb 2020 19:22:30 +0900 |
parents | c6893847c73a |
children | c7527f24e344 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java |
diffstat | 2 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Fri Feb 07 17:57:05 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Fri Feb 07 19:22:30 2020 +0900 @@ -92,7 +92,7 @@ newMulticastPacket(rfb, rect); //c1.put(header.get(0)); if (!blocking) { - deflater.setInput(bytes, 0, prevoffset); + deflater.setInput(bytes, 0,(int) prevoffset); deflater.deflate(c1); flushMuticast(rfb, bytes); } @@ -162,7 +162,7 @@ if (!deflater.needsInput()) { // compression failed flushDeflator(bytes); - prevoffset += bytesRead; + prevoffset = flushOffset+(int)bytesRead; flushRectangle(rect); flushMuticast(rfb, bytes); if (last && bytesRead == span) { @@ -239,7 +239,6 @@ c1.flip(); //System.out.println("multicastPut: " + c1rect + " length: " + (c1.remaining()-c1headerPos-header.limit())); deflater.reset(); - LinkedList<ByteBuffer> bufs = new LinkedList<ByteBuffer>(); bufs.add(c1); rfb.getContext().checkFrameBufferRectanble(c1, checkBytes, flushOffset, prevoffset);
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Feb 07 17:57:05 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Feb 07 19:22:30 2020 +0900 @@ -414,7 +414,7 @@ if (buf.remaining() == span) { }else { - System.out.println("Bytes is not equal length"); + System.out.println("Bytes is not equal length "+buf.remaining()+" != "+span); } }