Also check for negative encodings, in case the server is throwing unexpected
garbage at us.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4942 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/CMsgReader.cxx b/common/rfb/CMsgReader.cxx
index e3b73bf..63d31d1 100644
--- a/common/rfb/CMsgReader.cxx
+++ b/common/rfb/CMsgReader.cxx
@@ -100,7 +100,7 @@
     readCopyRect(r);
   } else {
 
-    if (encoding > encodingMax) {
+    if (!Decoder::supported(encoding)) {
       fprintf(stderr, "Unknown rect encoding %d\n", encoding);
       throw Exception("Unknown rect encoding");
     }