SLnkdwf Versie 4.23

FCLT#64230 Minder hard crashen op ongeldige foto

svn path=/Slnkdwf/trunk/; revision=48554
This commit is contained in:
Jos Groot Lipman
2020-10-22 11:06:27 +00:00
parent 8681e2c68c
commit e039fc5999
4 changed files with 27 additions and 5 deletions

View File

@@ -93,7 +93,25 @@ int FindFormat(const CString& ext)
return type;
}
// Extra Open wrapper om met __try een eventuele Win32 exception ook op te vangen
STDMETHODIMP CImageConvert::Open(BSTR IMGPath)
{
myTRACE("\nAbout to Open %ls", (LPCTSTR)IMGPath);
__try {
return Open2(IMGPath);
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
DWORD exCode = GetExceptionCode();
myDoTRACE("\nUnhandled Win32 exception 0x%x in CImageConvert::Open", exCode);
return myAtlReportError(GetObjectCLSID(), "\CImageConvert::Open('%ls')\nUnhandled Win32 exception 0x%x", (LPCSTR)IMGPath, exCode);
}
}
STDMETHODIMP CImageConvert::Open2(BSTR IMGPath)
{
CString filein(IMGPath);
CString extin(FindExtension(filein));
@@ -103,7 +121,7 @@ STDMETHODIMP CImageConvert::Open(BSTR IMGPath)
return myAtlReportError (GetObjectCLSID(), "Unknown extension loading %s", filein);
}
try
try
{
if (!m_image.Load(filein, typein)) {
return myAtlReportError(GetObjectCLSID(), "Error loading %s\n%s", filein, m_image.GetLastError());

View File

@@ -57,6 +57,7 @@ private:
public:
STDMETHOD(Open)(BSTR IMGPath);
STDMETHOD(Open2)(BSTR IMGPath);
STDMETHOD(SaveAs)(BSTR IMGPath);
STDMETHOD(get_Height)(LONG* pVal);
STDMETHOD(put_Height)(LONG newVal);

View File

@@ -761,10 +761,8 @@ STDMETHODIMP CWhipFile::SaveAs(BSTR WhipPath, VARIANT_BOOL ascii)
{
DWORD exCode = GetExceptionCode();
myDoTRACE("\nUnhandled Win32 exception 0x%x in CWhipFile::SaveAs", exCode);
char err[128];
sprintf_s(err, "\nUnhandled Win32 exception 0x%x", exCode);
return myAtlReportError (GetObjectCLSID(), "\nCWhipFile::SaveAs('%ls')\n%s", (LPCSTR)WhipPath, err);
return myAtlReportError (GetObjectCLSID(), "\nCWhipFile::SaveAs('%ls')\nUnhandled Win32 exception 0x%x", (LPCSTR)WhipPath, exCode);
}
}

View File

@@ -1,4 +1,9 @@
V4.22 xx-xx-xxxx
V4.23 22-10-2020
- Win32 Exceptions bij omgeldig plaatje iets beter afvangen
- Bij roteren over vaste hoek (0/90/180/27) dat ook rond 0,0 doen
voorkomt overflows.
V4.22 24-06-2020
- DWFExceptions iets beter afvangen
- Bij roteren over vaste hoek (0/90/180/27) dat ook rond 0,0 doen
voorkomt overflows.