garbage at us.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4942
3789f03b-4d11-0410-bbf8-
ca57d06f2519
readCopyRect(r);
} else {
- if (encoding > encodingMax) {
+ if (!Decoder::supported(encoding)) {
fprintf(stderr, "Unknown rect encoding %d\n", encoding);
throw Exception("Unknown rect encoding");
}
bool Decoder::supported(int encoding)
{
- return encoding <= encodingMax && createFns[encoding];
+ return encoding >= 0 && encoding <= encodingMax && createFns[encoding];
}
Decoder* Decoder::createDecoder(int encoding, CMsgReader* reader)
{
- if (encoding <= encodingMax && createFns[encoding])
+ if (supported(encoding))
return (*createFns[encoding])(reader);
return 0;
}