diff options
Diffstat (limited to 'java/com/tigervnc/rfb/PixelBuffer.java')
-rw-r--r-- | java/com/tigervnc/rfb/PixelBuffer.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/java/com/tigervnc/rfb/PixelBuffer.java b/java/com/tigervnc/rfb/PixelBuffer.java index 88b3a89e..4627318d 100644 --- a/java/com/tigervnc/rfb/PixelBuffer.java +++ b/java/com/tigervnc/rfb/PixelBuffer.java @@ -41,13 +41,12 @@ public class PixelBuffer { case 6: // Fall-through to depth 8 case 8: + if (cm != null && cm instanceof IndexColorModel) + break; int rmask = pf.redMax << pf.redShift; int gmask = pf.greenMax << pf.greenShift; int bmask = pf.blueMax << pf.blueShift; - if (pf.trueColour) - cm = new DirectColorModel(8, rmask, gmask, bmask); - else - cm = new IndexColorModel(8, 256, new byte[256], new byte[256], new byte[256]); + cm = new DirectColorModel(8, rmask, gmask, bmask); break; case 16: cm = new DirectColorModel(32, 0xF800, 0x07C0, 0x003E, (0xff << 24)); |