aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2021-11-04 09:00:33 +0100
committerPierre Ossman <ossman@cendio.se>2021-11-04 09:00:33 +0100
commit0ce9fefde8c0b34eda0d6c2454abb8fece7e6e3c (patch)
tree14f952ef968004899b5a870b31de1758c32f2fad
parent195388d3aa7da1972da12bac4d952b341ace0bc6 (diff)
downloadtigervnc-0ce9fefde8c0b34eda0d6c2454abb8fece7e6e3c.tar.gz
tigervnc-0ce9fefde8c0b34eda0d6c2454abb8fece7e6e3c.zip
Throw more descriptive error on rect read error
Gives a bit more context where this error happened.
-rw-r--r--common/rfb/DecodeManager.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/rfb/DecodeManager.cxx b/common/rfb/DecodeManager.cxx
index 4f60cd59..720aabed 100644
--- a/common/rfb/DecodeManager.cxx
+++ b/common/rfb/DecodeManager.cxx
@@ -136,8 +136,12 @@ bool DecodeManager::decodeRect(const Rect& r, int encoding,
// Read the rect
bufferStream->clear();
- if (!decoder->readRect(r, conn->getInStream(), conn->server, bufferStream))
- return false;
+ try {
+ if (!decoder->readRect(r, conn->getInStream(), conn->server, bufferStream))
+ return false;
+ } catch (rdr::Exception& e) {
+ throw Exception("Error reading rect: %s", e.str());
+ }
// Then try to put it on the queue
entry = new QueueEntry;