diff options
author | Christian Authmann <8371862+cauthmann@users.noreply.github.com> | 2018-11-11 10:40:48 +0100 |
---|---|---|
committer | Christian Authmann <8371862+cauthmann@users.noreply.github.com> | 2018-11-11 10:40:48 +0100 |
commit | 82b04eb2754c979506724af5d1f9c5994c5e5654 (patch) | |
tree | 849ee1933b22fa5393553d7f7cf4c289b437a442 /vncviewer | |
parent | b85febcd752f38cc05233db628795f8fea91795f (diff) | |
download | tigervnc-82b04eb2754c979506724af5d1f9c5994c5e5654.tar.gz tigervnc-82b04eb2754c979506724af5d1f9c5994c5e5654.zip |
Prevent rendering uninitialized Pixmap contents on X11
The Pixmap is filled in as updates from the server arrive. Before the first full update, it would contain undefined contents, which would be rendered onto the ViewPort.
Clearing the Pixmap is only done on startup and when changing the server resolution, so it's not performance critical.
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/PlatformPixelBuffer.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vncviewer/PlatformPixelBuffer.cxx b/vncviewer/PlatformPixelBuffer.cxx index e6a054ab..be6f7049 100644 --- a/vncviewer/PlatformPixelBuffer.cxx +++ b/vncviewer/PlatformPixelBuffer.cxx @@ -58,6 +58,9 @@ PlatformPixelBuffer::PlatformPixelBuffer(int width, int height) : data = (rdr::U8*)xim->data; stride = xim->bytes_per_line / (getPF().bpp/8); + + // On X11, the Pixmap backing this Surface is uninitialized. + clear(0, 0, 0); #else FullFramePixelBuffer::data = (rdr::U8*)Surface::data; stride = width; |