]> source.dussan.org Git - tigervnc.git/commitdiff
Check bit-per-pixel when the pixel format assign from the command line.
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Tue, 22 Mar 2005 15:02:39 +0000 (15:02 +0000)
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Tue, 22 Mar 2005 15:02:39 +0000 (15:02 +0000)
It must <= 32 bits.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@265 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfbplayer/rfbplayer.cxx

index 4c3cf3fb97c7ef2183f58a45afcaa11af9ef9f58..da479993446832a23751c5de5c99c177f1aca216 100644 (file)
@@ -1288,7 +1288,7 @@ bool processParams(int argc, char* argv[]) {
         }
         pf++;
       }
-      if ((r < 0) || (g < 0) || (b < 0)) return false;
+      if ((r < 0) || (g < 0) || (b < 0) || (r + g + b > 32)) return false;
       if (strcasecmp(rgb_order, "rgb") == 0) { order = RGB_ORDER; }
       else if (strcasecmp(rgb_order, "rbg") == 0) { order = RBG_ORDER; }
       else if (strcasecmp(rgb_order, "grb") == 0) { order = GRB_ORDER; }