Skip to content

Commit

Permalink
Image: don't dlclose(imageMagick)
Browse files Browse the repository at this point in the history
Fix: #552
  • Loading branch information
CarterLi committed Dec 18, 2023
1 parent 11b1b97 commit 600f6c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Bugfixes:
* Fix memory usage counting algorithm (Memory, macOS)
* Fix the behavior of `--no-buffer` in Windows
* Fix possible segfault in some devices (Display, Linux)
* Fix segfaults on first use of new images with Sixel flag (Image)

Logo:
* Remove unnecessary escaping for Adelie logo
Expand Down
5 changes: 4 additions & 1 deletion src/logo/image/im6.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ FFLogoImageResult ffLogoPrintImageIM6(FFLogoRequestData* requestData)
FF_LIBRARY_LOAD(imageMagick, &instance.config.library.libImageMagick, FF_LOGO_IMAGE_RESULT_INIT_ERROR, "libMagickCore-6.Q16HDRI" FF_LIBRARY_EXTENSION, 8, "libMagickCore-6.Q16" FF_LIBRARY_EXTENSION, 8)
FF_LIBRARY_LOAD_SYMBOL_ADDRESS(imageMagick, ffResizeImage, ResizeImage, FF_LOGO_IMAGE_RESULT_INIT_ERROR);

return ffLogoPrintImageImpl(requestData, &(FFIMData) {
FFLogoImageResult result = ffLogoPrintImageImpl(requestData, &(FFIMData) {
.resizeFunc = logoResize,
.library = imageMagick,
});

imageMagick = NULL; // leak imageMagick to prevent fastfetch from crashing #552
return result;
}

#endif
5 changes: 4 additions & 1 deletion src/logo/image/im7.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ FFLogoImageResult ffLogoPrintImageIM7(FFLogoRequestData* requestData)
)
FF_LIBRARY_LOAD_SYMBOL_ADDRESS(imageMagick, ffResizeImage, ResizeImage, FF_LOGO_IMAGE_RESULT_INIT_ERROR);

return ffLogoPrintImageImpl(requestData, &(FFIMData) {
FFLogoImageResult result = ffLogoPrintImageImpl(requestData, &(FFIMData) {
.resizeFunc = logoResize,
.library = imageMagick,
});

imageMagick = NULL; // leak imageMagick to prevent fastfetch from crashing #552
return result;
}

#endif

0 comments on commit 600f6c7

Please sign in to comment.