BUG: Use of of wrong width and height methods in PlatformPixelBuffer::setupShm

Skip to first unread message

Joachim Falk

Dec 28, 2019, 3:14:29 PM12/28/19
to TigerVNC Developer Discussion, Pierre Ossman
Hi Pierre,

I think there is a bug for UNIX platforms in PlatformPixelBuffer::setupShm introduced in v1.10.1.
Details as follows:

PlatformPixelBuffer::setupShm uses the width() and height() methods to
determine the correct geometry for a XImage. However, the width() and height()
methods are defined in both the Surface as well as the FullFramePixelBuffer
base classes of PlatformPixelBuffer. Before v1.10.1 these methods accessed
fields that where both initialized to the requested image dimensions.
However, starting from v1.10.1 the width() and height() methods of
FullFramePixelBuffer return zero when setupShm is called. It will later be
initialized to the correct dimensions by a setBuffer method call in the
constructor of PlatformPixelBuffer.
This patch switches to Surface::{width,height} which return the correct dimensions.


Joachim Falk

Pierre Ossman

Dec 30, 2019, 4:54:48 AM12/30/19
to Joachim Falk, TigerVNC Developer Discussion
Oops. Thanks for finding this. Fortunately the consequences of this is
"just" worse performance, but it was still definitely unintentional.

I've commited a different fix as 0f1ded05 that avoids the confusion of
relying on the base classes during setup. Many thanks for spotting this
and suggesting a fix though.

Pierre Ossman Software Development
Cendio AB https://cendio.com
Teknikringen 8 https://twitter.com/ThinLinc
583 30 Linköping https://facebook.com/ThinLinc
Phone: +46-13-214600

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Reply all
Reply to author
0 new messages