Skip to content

Commit 17ce276

Browse files
committed
Replace FreeImage dependency with stb
This removes FreeImage dependency. This library is full of security vulnerabilities [1][2] and distributions such as NixOS and Arch no longer ship it, making it difficult to build Gazebo there. It's not an option to replace FreeImage with its fork called FreeImageRe [3], which fixes some of the vulnerabilities, because many of them still seem to be present. Therefore, we replace FreeImage with the stb project [4], which seems to have better security track record [5]. We vendor the header files from the project from its commit f1c79c0 ("Merge pull request 1851 from jeffrbig2/master", 2025-10-25). With this implementation all tests pass, but it is quite likely that some things will behave differently. Likely the support of 16-bit or HDR (32-bit float) images will behave differently. For example, PNG saving is supported only for 8-bit images. [1]: https://security-tracker.debian.org/tracker/source-package/freeimage [2]: https://www.cvedetails.com/vendor/15676/ [3]: https://github.com/agruzdev/FreeImageRe [4]: https://github.com/nothings/stb [5]: https://www.cvedetails.com/vendor/19263/Stb-Project.html Closes #388 Signed-off-by: Michal Sojka <michal.sojka@cvut.cz>
1 parent 58c6eaa commit 17ce276

File tree

8 files changed

+20693
-435
lines changed

8 files changed

+20693
-435
lines changed

‎CMakeLists.txt‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ if(NOT WIN32)
5858
gz_find_package(UUID REQUIRED PRETTY uuid)
5959
endif()
6060

61-
#------------------------------------
62-
# Find Freeimage
63-
gz_find_package(FreeImage VERSION 3.9
64-
REQUIRED_BY graphics
65-
PRIVATE_FOR graphics)
66-
6761
#------------------------------------
6862
# Find GDAL
6963
gz_find_package(GDAL VERSION 3.0

‎graphics/src/CMakeLists.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ target_link_libraries(${graphics_target}
88
gz-utils::gz-utils
99
PRIVATE
1010
${GzAssimp_LIBRARIES}
11-
FreeImage::FreeImage
1211
TINYXML2::TINYXML2
1312
)
1413

0 commit comments

Comments
 (0)