Fix log format misuse

Harden log channel methods against non-constant string.
This commit is contained in:
Nekotekina 2019-10-09 02:14:52 +03:00
parent a29d4150df
commit 8f604ddded
4 changed files with 8 additions and 8 deletions

View file

@ -149,7 +149,7 @@ void pngDecEndCallback(png_structp png_ptr, png_infop info)
// Custom error handler for libpng
void pngDecError(png_structp png_ptr, png_const_charp error_message)
{
cellPngDec.error(error_message);
cellPngDec.error("%s", error_message);
// we can't return here or libpng blows up
throw LibPngCustomException("Fatal Error in libpng");
}
@ -157,7 +157,7 @@ void pngDecError(png_structp png_ptr, png_const_charp error_message)
// Custom warning handler for libpng
void pngDecWarning(png_structp png_ptr, png_const_charp error_message)
{
cellPngDec.warning(error_message);
cellPngDec.warning("%s", error_message);
}
// Get the chunk information of the PNG file. IDAT is marked as existing, only after decoding or reading the header.