Commit 27ae589d authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

windowscodecs: Fix crash when PNG decoder is freed without successful init.

parent 2da8f9a9
...@@ -442,7 +442,8 @@ static ULONG WINAPI PngDecoder_Release(IWICBitmapDecoder *iface) ...@@ -442,7 +442,8 @@ static ULONG WINAPI PngDecoder_Release(IWICBitmapDecoder *iface)
if (ref == 0) if (ref == 0)
{ {
IStream_Release(This->stream); if (This->stream)
IStream_Release(This->stream);
if (This->png_ptr) if (This->png_ptr)
ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, &This->end_info); ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, &This->end_info);
This->lock.DebugInfo->Spare[0] = 0; This->lock.DebugInfo->Spare[0] = 0;
...@@ -1218,6 +1219,7 @@ HRESULT PngDecoder_CreateInstance(REFIID iid, void** ppv) ...@@ -1218,6 +1219,7 @@ HRESULT PngDecoder_CreateInstance(REFIID iid, void** ppv)
This->png_ptr = NULL; This->png_ptr = NULL;
This->info_ptr = NULL; This->info_ptr = NULL;
This->end_info = NULL; This->end_info = NULL;
This->stream = NULL;
This->initialized = FALSE; This->initialized = FALSE;
This->image_bits = NULL; This->image_bits = NULL;
InitializeCriticalSection(&This->lock); InitializeCriticalSection(&This->lock);
......
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