mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 06:27:38 +00:00
[ATL] CImage::Load(): Return E_FAIL without ATLASSERT on failure (#4993)
Application won't be interrupted by ATLASSERT when image load failure happens, just like it was done in MS ATL. CORE-18589
This commit is contained in:
parent
74c45e0975
commit
21a168e574
|
@ -382,8 +382,10 @@ public:
|
||||||
// create a GpBitmap object from file
|
// create a GpBitmap object from file
|
||||||
using namespace Gdiplus;
|
using namespace Gdiplus;
|
||||||
GpBitmap *pBitmap = NULL;
|
GpBitmap *pBitmap = NULL;
|
||||||
GetCommon().CreateBitmapFromFile(pszNameW, &pBitmap);
|
if (GetCommon().CreateBitmapFromFile(pszNameW, &pBitmap) != Ok)
|
||||||
ATLASSERT(pBitmap);
|
{
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO & FIXME: get parameters (m_rgbTransColor etc.)
|
// TODO & FIXME: get parameters (m_rgbTransColor etc.)
|
||||||
|
|
||||||
|
@ -407,8 +409,10 @@ public:
|
||||||
// create GpBitmap from stream
|
// create GpBitmap from stream
|
||||||
using namespace Gdiplus;
|
using namespace Gdiplus;
|
||||||
GpBitmap *pBitmap = NULL;
|
GpBitmap *pBitmap = NULL;
|
||||||
GetCommon().CreateBitmapFromStream(pStream, &pBitmap);
|
if (GetCommon().CreateBitmapFromStream(pStream, &pBitmap) != Ok)
|
||||||
ATLASSERT(pBitmap);
|
{
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO & FIXME: get parameters (m_rgbTransColor etc.)
|
// TODO & FIXME: get parameters (m_rgbTransColor etc.)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue