aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2012-03-06 02:49:56 +0000
committerBrian Hinz <bphinz@users.sourceforge.net>2012-03-06 02:49:56 +0000
commit32fee352971d8b788fece36beeb4b79665cdb023 (patch)
treedc63fe9f6b2e3d14e07a7b3bd87ffcd02387b67c /java
parent44bc7d23d109cbab01555ddc3933eea65caa5a1f (diff)
downloadtigervnc-32fee352971d8b788fece36beeb4b79665cdb023.tar.gz
tigervnc-32fee352971d8b788fece36beeb4b79665cdb023.zip
Fix problem noted in feature request 3482254 where selecting Raw encoding caused the Java viewer to freeze.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4861 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java')
-rw-r--r--java/com/tigervnc/rfb/RawDecoder.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/java/com/tigervnc/rfb/RawDecoder.java b/java/com/tigervnc/rfb/RawDecoder.java
index f7e5d46a..6be535b2 100644
--- a/java/com/tigervnc/rfb/RawDecoder.java
+++ b/java/com/tigervnc/rfb/RawDecoder.java
@@ -27,12 +27,13 @@ public class RawDecoder extends Decoder {
int y = r.tl.y;
int w = r.width();
int h = r.height();
- int[] imageBuf = reader.getImageBuf(w * h);
- int nPixels = imageBuf.length / (reader.bpp() / 8);
+ int[] imageBuf = new int[w*h];
+ int nPixels = imageBuf.length;
+ int bytesPerRow = w * (reader.bpp() / 8);
while (h > 0) {
int nRows = nPixels / w;
if (nRows > h) nRows = h;
- reader.is.readPixels(imageBuf, w * h, (reader.bpp() / 8), handler.cp.pf().bigEndian);
+ reader.getInStream().readPixels(imageBuf, nPixels, (reader.bpp() / 8), handler.cp.pf().bigEndian);
handler.imageRect(new Rect(x, y, x+w, y+nRows), imageBuf);
h -= nRows;
y += nRows;