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

13 views
Skip to first unread message

Joachim Falk

unread,
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.

Best,

Joachim Falk
0177-tigervnc-1.10.1-fix-setupShm-wrong-width-heigh-method.patch
signature.asc

Pierre Ossman

unread,
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.

Regards
--
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
Forward
0 new messages