From 229229648fa3c2e035306d1845a20c9240b1a383 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 19 Jul 2012 11:06:27 +0000 Subject: 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 --- common/rfb/CMsgReader.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/rfb/CMsgReader.cxx') diff --git a/common/rfb/CMsgReader.cxx b/common/rfb/CMsgReader.cxx index e3b73bf5..63d31d1a 100644 --- a/common/rfb/CMsgReader.cxx +++ b/common/rfb/CMsgReader.cxx @@ -100,7 +100,7 @@ void CMsgReader::readRect(const Rect& r, int encoding) readCopyRect(r); } else { - if (encoding > encodingMax) { + if (!Decoder::supported(encoding)) { fprintf(stderr, "Unknown rect encoding %d\n", encoding); throw Exception("Unknown rect encoding"); } -- cgit v1.2.3