Commit d079b66b authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdiplus: Avoid casting IWICBitmapFrameDecode to IWICBitmapSource.

parent 7f9230c5
......@@ -2676,12 +2676,14 @@ static GpStatus decode_image_wic(IStream* stream, REFCLSID clsid, UINT active_fr
if (SUCCEEDED(hr))
{
IWICBitmapSource *bmp_source;
IWICBitmapFrameDecode_QueryInterface(frame, &IID_IWICBitmapSource, (void **)&bmp_source);
for (i=0; wic_pixel_formats[i]; i++)
{
if (IsEqualGUID(&wic_format, wic_pixel_formats[i]))
{
source = (IWICBitmapSource*)frame;
IWICBitmapSource_AddRef(source);
source = bmp_source;
gdip_format = wic_gdip_formats[i];
break;
}
......@@ -2689,8 +2691,9 @@ static GpStatus decode_image_wic(IStream* stream, REFCLSID clsid, UINT active_fr
if (!source)
{
/* unknown format; fall back on 32bppARGB */
hr = WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA, (IWICBitmapSource*)frame, &source);
hr = WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA, bmp_source, &source);
gdip_format = PixelFormat32bppARGB;
IWICBitmapSource_Release(bmp_source);
}
}
......
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