Skip to content
Snippets Groups Projects
Commit 27ae589d authored by Esme Povirk's avatar Esme Povirk Committed by Alexandre Julliard
Browse files

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

parent 2da8f9a9
No related branches found
No related tags found
No related merge requests found
......@@ -442,7 +442,8 @@ static ULONG WINAPI PngDecoder_Release(IWICBitmapDecoder *iface)
if (ref == 0)
{
IStream_Release(This->stream);
if (This->stream)
IStream_Release(This->stream);
if (This->png_ptr)
ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, &This->end_info);
This->lock.DebugInfo->Spare[0] = 0;
......@@ -1218,6 +1219,7 @@ HRESULT PngDecoder_CreateInstance(REFIID iid, void** ppv)
This->png_ptr = NULL;
This->info_ptr = NULL;
This->end_info = NULL;
This->stream = NULL;
This->initialized = FALSE;
This->image_bits = NULL;
InitializeCriticalSection(&This->lock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment