Dmitry Timoshkov : windowscodecs: Ask libpng to ignore CRC of PNG chunks.
Alexandre Julliard
julliard at winehq.org
Thu Mar 7 13:57:14 CST 2013
Module: wine
Branch: master
Commit: ec22949874f9051eff6209fde43346a4bb5997fd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ec22949874f9051eff6209fde43346a4bb5997fd
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Thu Mar 7 15:26:13 2013 +0900
windowscodecs: Ask libpng to ignore CRC of PNG chunks.
According to my tests with manually created PNG images WIC ignores CRC errors
for both critical and ancillary chunks.
---
dlls/windowscodecs/pngformat.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index fb8bf51..2f6a9e3 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -174,6 +174,7 @@ MAKE_FUNCPTR(png_get_pHYs);
MAKE_FUNCPTR(png_get_PLTE);
MAKE_FUNCPTR(png_get_tRNS);
MAKE_FUNCPTR(png_set_bgr);
+MAKE_FUNCPTR(png_set_crc_action);
MAKE_FUNCPTR(png_set_error_fn);
#if HAVE_PNG_SET_EXPAND_GRAY_1_2_4_TO_8
MAKE_FUNCPTR(png_set_expand_gray_1_2_4_to_8);
@@ -222,6 +223,7 @@ static void *load_libpng(void)
LOAD_FUNCPTR(png_get_PLTE);
LOAD_FUNCPTR(png_get_tRNS);
LOAD_FUNCPTR(png_set_bgr);
+ LOAD_FUNCPTR(png_set_crc_action);
LOAD_FUNCPTR(png_set_error_fn);
#if HAVE_PNG_SET_EXPAND_GRAY_1_2_4_TO_8
LOAD_FUNCPTR(png_set_expand_gray_1_2_4_to_8);
@@ -438,6 +440,7 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
goto end;
}
ppng_set_error_fn(This->png_ptr, jmpbuf, user_error_fn, user_warning_fn);
+ ppng_set_crc_action(This->png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
/* seek to the start of the stream */
seek.QuadPart = 0;
More information about the wine-cvs
mailing list