Closed smcv closed 6 months ago
Better reproducer:
$ podman pull registry.gitlab.steamos.cloud/steamrt/scout/sdk:beta
$ podman run --rm -it registry.gitlab.steamos.cloud/steamrt/scout/sdk:beta
# cd
# git clone -bSDL2 https://github.com/libsdl-org/SDL_image
# cd SDL_image
# autoreconf -fi
# ./configure --enable-tests --disable-stb-image
(AVIF and JXL libraries are not found, this is OK)
# make
# make check VERBOSE=1
To reproduce:
IMG_SaveJPG_RW_jpeglib()
fails. I'm currently trying to backport SDL_image 2.8.2 to Steam Runtime version 1 'scout', an Ubuntu-12.04-based environment, and for whatever reason it's failing; I'll address that eventually when I've figured out what is happening, but for now, it provides a convenient way to exercise failure code-paths that are not normally reached.IMG_SaveJPG_RW_jpeglib()
fail, for example by running SDL_image's own test suiteExpected result: Saving with libjpeg fails. SDL_image catches the error and maybe tries to fall back to tinyjpeg. Either the file is saved successfully with tinyjpeg, or tinyjpeg fails cleanly too; either way, there is no crash.
Actual result: When
IMG_SaveJPG_RW_jpeglib()
setsjerr.errmgr.error_exit = my_error_exit
, the result of a failure is alongjmp
intojerr.escape
, butIMG_SaveJPG_RW_jpeglib()
never actually initializesjerr.escape
and the result is a crash.Suggested solution:
IMG_SaveJPG_RW_jpeglib()
shouldsetjmp(jerr.escape)
before it starts compression, the same as in the libjpeg loading code path.