Module: wine Branch: master Commit: 27ae589d2aee548d06401153a2bdc5f9af98329d URL: http://source.winehq.org/git/wine.git/?a=commit;h=27ae589d2aee548d06401153a2...
Author: Vincent Povirk vincent@codeweavers.com Date: Fri Apr 10 11:39:34 2015 -0500
windowscodecs: Fix crash when PNG decoder is freed without successful init.
---
dlls/windowscodecs/pngformat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index 2aac560..f39b31a 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -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);