Skip to content

Prefix embedded TurboJPEG functions with rdr_ to prevent symbol conflicts - #741

Open
M3ML1NE wants to merge 1 commit into
LibVNC:masterfrom
M3ML1NE:fix/auto-bounty-729-turbojpeg-prefix
Open

M3ML1NE wants to merge 1 commit into
LibVNC:masterfrom
M3ML1NE:fix/auto-bounty-729-turbojpeg-prefix

Conversation

@M3ML1NE

@M3ML1NE M3ML1NE commented Aug 11, 2026 •

Copy link
Copy Markdown

Fixes #729.

Problem

When an application links against both libvncserver and system libjpeg-turbo (directly or indirectly), calling TurboJPEG functions (like tjCompress2, tjDecompress, etc.) resolves to libvncserver's internal embedded implementation instead of system libjpeg-turbo due to exported symbol collision. This causes unexpected behaviors and potential crashes in downstream applications.

Solution

Prefix internal TurboJPEG function names and macros with rdr_ (rdr_tjInitCompress, rdr_tjCompress2, rdr_tjDecompress, etc.) in src/common/turbojpeg.h, src/common/turbojpeg.c, and internal consumers (src/libvncserver/tight.c, src/libvncclient/tight.c, src/libvncclient/vncviewer.c, and tests).

Verification

  • Built libvncserver via CMake.
  • Ran readelf -Ws build/libvncserver.so | grep tj and verified no global tj* symbols are exported.
  • Executed unit tests (ctest), all 4 tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exports conflicting turbojpeg functions

1 participant