]> source.dussan.org Git - tigervnc.git/commitdiff
make sure that color map is set for all pixel formats or throw an exception
authorBrian Hinz <bphinz@users.sourceforge.net>
Thu, 8 Dec 2011 02:16:53 +0000 (02:16 +0000)
committerBrian Hinz <bphinz@users.sourceforge.net>
Thu, 8 Dec 2011 02:16:53 +0000 (02:16 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4823 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/com/tigervnc/rfb/PixelBuffer.java

index f87fead8815a4487458befeb4d2c4e91c530f761..2712ba94411418c7d863ac0abaec19fe447c493c 100644 (file)
@@ -46,6 +46,12 @@ public class PixelBuffer {
     case 24: 
       cm = new DirectColorModel(32, (0xff << 16), (0xff << 8), 0xff, (0xff << 24));
       break;
+    case 32: 
+      cm = new DirectColorModel(32, (0xff << pf.redShift), 
+        (0xff << pf.greenShift), (0xff << pf.blueShift), (0xff << 24));
+      break;
+    default:
+      throw new Exception("Unsupported color depth ("+pf.depth+")");
     }
   }
   public PixelFormat getPF() { return format; }