Commit 31682b3d authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

d3dx9_36: Don't check the image format in D3DXLoadSurfaceFromFileInMemory.

If the format is not supported, D3DXGetImageInfoFromFileInMemory will fail.
parent 384b9553
......@@ -314,6 +314,15 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 pDestSurface,
D3DXIMAGE_INFO imginfo;
HRESULT hr;
IWICImagingFactory *factory;
IWICBitmapDecoder *decoder;
IWICBitmapFrameDecode *bitmapframe;
IWICStream *stream;
const PixelFormatDesc *formatdesc;
WICRect wicrect;
RECT rect;
TRACE("(%p, %p, %p, %p, %d, %p, %d, %x, %p)\n", pDestSurface, pDestPalette, pDestRect, pSrcData,
SrcDataSize, pSrcRect, dwFilter, Colorkey, pSrcInfo);
......@@ -325,21 +334,6 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 pDestSurface,
if (FAILED(hr))
return hr;
switch (imginfo.ImageFileFormat)
{
case D3DXIFF_BMP:
case D3DXIFF_PNG:
case D3DXIFF_JPG:
{
IWICImagingFactory *factory;
IWICBitmapDecoder *decoder;
IWICBitmapFrameDecode *bitmapframe;
IWICStream *stream;
const PixelFormatDesc *formatdesc;
WICRect wicrect;
RECT rect;
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if (FAILED(CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, (void**)&factory)))
......@@ -421,14 +415,6 @@ cleanup_err:
if (FAILED(hr))
return D3DXERR_INVALIDDATA;
break;
}
default:
FIXME("Unsupported image file format\n");
return E_NOTIMPL;
}
if (pSrcInfo)
*pSrcInfo = imginfo;
......
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