aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/EncodeManager.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2019-09-10 15:25:30 +0200
committerPierre Ossman <ossman@cendio.se>2019-11-15 11:20:26 +0100
commit9f615301aba1cc54a749950bf9462c5a85217bc4 (patch)
tree1d5db41665fbe20dae80c22276633c5efae7c8a2 /common/rfb/EncodeManager.cxx
parent996356b6c65ca165ee1ea46a571c32a1dc3c3821 (diff)
downloadtigervnc-9f615301aba1cc54a749950bf9462c5a85217bc4.tar.gz
tigervnc-9f615301aba1cc54a749950bf9462c5a85217bc4.zip
Add write protection to OffsetPixelBuffer
No one should every try to write to this buffer. Enforce that by throwing an exception if any one tries to get a writeable pointer to the data.
Diffstat (limited to 'common/rfb/EncodeManager.cxx')
-rw-r--r--common/rfb/EncodeManager.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/rfb/EncodeManager.cxx b/common/rfb/EncodeManager.cxx
index 54f7102b..92ac5676 100644
--- a/common/rfb/EncodeManager.cxx
+++ b/common/rfb/EncodeManager.cxx
@@ -28,6 +28,7 @@
#include <rfb/SMsgWriter.h>
#include <rfb/UpdateTracker.h>
#include <rfb/LogWriter.h>
+#include <rfb/Exception.h>
#include <rfb/RawEncoder.h>
#include <rfb/RREEncoder.h>
@@ -1053,6 +1054,11 @@ void EncodeManager::OffsetPixelBuffer::update(const PixelFormat& pf,
setBuffer(width, height, (rdr::U8*)data_, stride_);
}
+rdr::U8* EncodeManager::OffsetPixelBuffer::getBufferRW(const Rect& r, int* stride)
+{
+ throw rfb::Exception("Invalid write attempt to OffsetPixelBuffer");
+}
+
// Preprocessor generated, optimised methods
#define BPP 8