diff options
Diffstat (limited to 'common/rfb/CMsgReader.cxx')
-rw-r--r-- | common/rfb/CMsgReader.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/rfb/CMsgReader.cxx b/common/rfb/CMsgReader.cxx index 38547c0f..cc288462 100644 --- a/common/rfb/CMsgReader.cxx +++ b/common/rfb/CMsgReader.cxx @@ -99,6 +99,12 @@ void CMsgReader::readRect(const Rect& r, unsigned int encoding) if (encoding == encodingCopyRect) { readCopyRect(r); } else { + + if (encoding > encodingMax) { + fprintf(stderr, "Unknown rect encoding %d\n", encoding); + throw Exception("Unknown rect encoding"); + } + if (!decoders[encoding]) { decoders[encoding] = Decoder::createDecoder(encoding, this); if (!decoders[encoding]) { |