Repository navigation
Conversation
sys_getmodes.cpp and OptionsSubMultiplayer.cpp included the bundled libjpeg v8 header (public/jpeglib), while on Linux the system libjpeg(-turbo) is linked (API 62). The `jpeg` console command aborted with "Wrong JPEG library version: library is 62, caller expects 80". Include <jpeglib.h> like common/imageutils.cpp already does; Windows and Android keep the bundled header. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Linux, taking a screenshot with the
jpegcommand (bound to F5 by default) aborts the game:This is the crash in #177, and probably also #455 (F5 pressed instead of quicksave on Debian 12).
Cause
On Linux,
wscriptlinks the system libjpeg (check_cfg(package='libjpeg')). On Debian and Fedora that is libjpeg-turbo with API version 62.engine/sys_getmodes.cppandgameui/OptionsSubMultiplayer.cpp(spray import), however, include the bundled libjpeg v8 header frompublic/jpeglib. libjpeg checks at runtime that the header version matches the library, and aborts when it does not.Fix
On Linux, both files now include the system
<jpeglib.h>, ascommon/imageutils.cppalready does. The header and the library then always come from the same package, whatever libjpeg version the distribution ships. Windows and Android keep the bundled header, because they also use the bundled library.Testing
Fedora 44 x86_64, a
jpegcommand ond1_canals_01:Wrong JPEG library version: library is 62, caller expects 80hl2/screenshots/snapshot0000.jpgis written (valid 1280×720 JPEG)How this was made
I made this together with Claude Code, Anthropic's AI coding assistant. I guided it throughout and kept the change small, following what
common/imageutils.cppalready does. I tested the result myself as described above.