Commit e1130d24 authored by Torge Matthies's avatar Torge Matthies Committed by Alexandre Julliard

windowscodecs: Disable libpng chunk size limit.

Reading a PNG file with libpng with a chunk bigger than the 8 MiB default chunk size limit set by libpng results in a libpng error, e.g. "iTXt: chunk data is too large" for a too big iTXt chunk. Fix this by disabling the chunk size limit. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52147Signed-off-by: 's avatarTorge Matthies <openglfreak@googlemail.com> Signed-off-by: 's avatarEsme Povirk <esme@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2abf0173
......@@ -107,6 +107,7 @@ static HRESULT CDECL png_decoder_initialize(struct decoder *iface, IStream *stre
goto end;
}
png_set_crc_action(png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
png_set_chunk_malloc_max(png_ptr, 0);
/* seek to the start of the stream */
hr = stream_seek(stream, 0, STREAM_SEEK_SET, NULL);
......
......@@ -944,7 +944,7 @@ static void test_chunk_size(void)
memcpy(png_8M_tEXt + sizeof(png_8M_tEXt) - sizeof(png_8M_tEXt_end), png_8M_tEXt_end, sizeof(png_8M_tEXt_end));
hr = create_decoder(png_8M_tEXt, sizeof(png_8M_tEXt), &decoder);
todo_wine ok(hr == S_OK, "Failed to load PNG image data %#x\n", hr);
ok(hr == S_OK, "Failed to load PNG image data %#x\n", hr);
if (hr != S_OK) return;
IWICBitmapDecoder_Release(decoder);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment