Commit cd778e0b authored by Esme Povirk's avatar Esme Povirk Committed by Alexandre Julliard

windowscodecs: Do not call png_read_end.

This isn't necessary because we do not use libpng to read metadata or verify checksums. If this happens to be the last thing we do, it will fail the pngformat tests which do not expect us to return with the stream seeked to the end of the file. Signed-off-by: 's avatarEsme Povirk <esme@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 980e6650
......@@ -61,7 +61,6 @@ MAKE_FUNCPTR(png_get_io_ptr);
MAKE_FUNCPTR(png_get_pHYs);
MAKE_FUNCPTR(png_get_PLTE);
MAKE_FUNCPTR(png_get_tRNS);
MAKE_FUNCPTR(png_read_end);
MAKE_FUNCPTR(png_read_image);
MAKE_FUNCPTR(png_read_info);
MAKE_FUNCPTR(png_set_bgr);
......@@ -111,7 +110,6 @@ static void *load_libpng(void)
LOAD_FUNCPTR(png_get_pHYs);
LOAD_FUNCPTR(png_get_PLTE);
LOAD_FUNCPTR(png_get_tRNS);
LOAD_FUNCPTR(png_read_end);
LOAD_FUNCPTR(png_read_image);
LOAD_FUNCPTR(png_read_info);
LOAD_FUNCPTR(png_set_bgr);
......@@ -183,7 +181,6 @@ HRESULT CDECL png_decoder_initialize(struct decoder *iface, IStream *stream, str
struct png_decoder *This = impl_from_decoder(iface);
png_structp png_ptr;
png_infop info_ptr;
png_infop end_info;
jmp_buf jmpbuf;
HRESULT hr = E_FAIL;
int color_type, bit_depth;
......@@ -216,13 +213,6 @@ HRESULT CDECL png_decoder_initialize(struct decoder *iface, IStream *stream, str
return E_FAIL;
}
end_info = ppng_create_info_struct(png_ptr);
if (!end_info)
{
ppng_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return E_FAIL;
}
/* set up setjmp/longjmp error handling */
if (setjmp(jmpbuf))
{
......@@ -443,7 +433,7 @@ HRESULT CDECL png_decoder_initialize(struct decoder *iface, IStream *stream, str
free(row_pointers);
row_pointers = NULL;
ppng_read_end(png_ptr, end_info);
/* png_read_end intentionally not called to not seek to the end of the file */
st->flags = WICBitmapDecoderCapabilityCanDecodeAllImages |
WICBitmapDecoderCapabilityCanDecodeSomeImages |
......@@ -455,7 +445,7 @@ HRESULT CDECL png_decoder_initialize(struct decoder *iface, IStream *stream, str
hr = S_OK;
end:
ppng_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
ppng_destroy_read_struct(&png_ptr, &info_ptr, NULL);
free(row_pointers);
if (FAILED(hr))
{
......
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