Commit 831b7371 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

windowscodecs: Fix memory leak in ComponentFactory_CreateBitmapFromSource.

parent 8340636c
......@@ -547,20 +547,22 @@ static HRESULT WINAPI ComponentFactory_CreateBitmapFromSource(IWICComponentFacto
IWICBitmapLock_Release(lock);
}
if (SUCCEEDED(hr))
hr = PaletteImpl_Create(&palette);
if (SUCCEEDED(hr) && (format_type == WICPixelFormatNumericRepresentationUnspecified ||
format_type == WICPixelFormatNumericRepresentationIndexed))
{
hr = IWICBitmapSource_CopyPalette(piBitmapSource, palette);
hr = PaletteImpl_Create(&palette);
if (SUCCEEDED(hr))
hr = IWICBitmap_SetPalette(result, palette);
else
hr = S_OK;
{
hr = IWICBitmapSource_CopyPalette(piBitmapSource, palette);
if (SUCCEEDED(hr))
hr = IWICBitmap_SetPalette(result, palette);
else
hr = S_OK;
IWICPalette_Release(palette);
IWICPalette_Release(palette);
}
}
if (SUCCEEDED(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