diff options
-rw-r--r-- | java/com/tigervnc/rfb/PixelBuffer.java | 5 |
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; |