windowscodecs: Fix crash when PNG decoder is freed without successful init.
This commit is contained in:
parent
2da8f9a9db
commit
27ae589d2a
|
@ -442,6 +442,7 @@ static ULONG WINAPI PngDecoder_Release(IWICBitmapDecoder *iface)
|
|||
|
||||
if (ref == 0)
|
||||
{
|
||||
if (This->stream)
|
||||
IStream_Release(This->stream);
|
||||
if (This->png_ptr)
|
||||
ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, &This->end_info);
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue