summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2012-12-11 22:12:35 +0000
committerBrian Hinz <bphinz@users.sourceforge.net>2012-12-11 22:12:35 +0000
commit5975ea6c74d5b663a8ef0304786e4b330a1f6108 (patch)
treed7c5d4bd414e9ea314af04f53383a37813da44d0 /java
parentb03679610960d7250621b5f5c188208ef378eb8b (diff)
downloadtigervnc-5975ea6c74d5b663a8ef0304786e4b330a1f6108.tar.gz
tigervnc-5975ea6c74d5b663a8ef0304786e4b330a1f6108.zip
Fixes regression introduced by r5016 (exception produced when connecting to 8bpp server)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5017 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java')
-rw-r--r--java/com/tigervnc/rfb/PixelBuffer.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/java/com/tigervnc/rfb/PixelBuffer.java b/java/com/tigervnc/rfb/PixelBuffer.java
index 4627318d..d7380b78 100644
--- a/java/com/tigervnc/rfb/PixelBuffer.java
+++ b/java/com/tigervnc/rfb/PixelBuffer.java
@@ -41,8 +41,11 @@ public class PixelBuffer {
case 6:
// Fall-through to depth 8
case 8:
- if (cm != null && cm instanceof IndexColorModel)
+ if (!pf.trueColour) {
+ if (cm == null)
+ cm = new IndexColorModel(8, 256, new byte[256], new byte[256], new byte[256]);
break;
+ }
int rmask = pf.redMax << pf.redShift;
int gmask = pf.greenMax << pf.greenShift;
int bmask = pf.blueMax << pf.blueShift;