mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-02-22 21:31:31 +01:00
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.
This commit is contained in:
parent
3282836baf
commit
6a3f711878
@ -31,6 +31,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>
|
||||
@ -1494,6 +1495,11 @@ void EncodeManager::OffsetPixelBuffer::update(const PixelFormat& pf,
|
||||
stride = 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
|
||||
|
@ -187,6 +187,9 @@ namespace rfb {
|
||||
|
||||
void update(const PixelFormat& pf, int width, int height,
|
||||
const rdr::U8* data_, int stride);
|
||||
|
||||
private:
|
||||
virtual rdr::U8* getBufferRW(const Rect& r, int* stride);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user