summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-11 21:18:41 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-12 09:57:44 +0200
commitd8b4d2f9c6fe710031471bea360e9223f29c3eea (patch)
tree756057669fdcf37b0834559c553553251ff74a2e /emfio
parentefa2681db1fb66e5f3677adff3a5e91ccba6b9ec (diff)
ofz#10301 Abrt
Change-Id: I3ec766dd243fa27068ec44b16c941beaa9da1479 Reviewed-on: https://gerrit.libreoffice.org/60359 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'emfio')
-rw-r--r--emfio/source/emfuno/xemfparser.cxx31
1 files changed, 19 insertions, 12 deletions
diff --git a/emfio/source/emfuno/xemfparser.cxx b/emfio/source/emfuno/xemfparser.cxx
index e9175de10d60..86edeb0aa944 100644
--- a/emfio/source/emfuno/xemfparser.cxx
+++ b/emfio/source/emfuno/xemfparser.cxx
@@ -139,21 +139,28 @@ namespace emfio
bool bReadError(false);
- if (nMetaType == 0x464d4520)
+ try
{
- // read and get possible failure/error, ReadEnhWMF returns success
- bReadError = !emfio::EmfReader(*pStream, aMtf).ReadEnhWMF();
- }
- else
- {
- emfio::WmfReader(*pStream, aMtf, bExternalHeaderUsed ? &aExternalHeader : nullptr).ReadWMF();
+ if (nMetaType == 0x464d4520)
+ {
+ // read and get possible failure/error, ReadEnhWMF returns success
+ bReadError = !emfio::EmfReader(*pStream, aMtf).ReadEnhWMF();
+ }
+ else
+ {
+ emfio::WmfReader(*pStream, aMtf, bExternalHeaderUsed ? &aExternalHeader : nullptr).ReadWMF();
- // Need to check for ErrCode at stream to not lose former work.
- // This may contain important information and will behave the
- // same as before. When we have an error, do not create content
- ErrCode aErrCode(pStream->GetError());
+ // Need to check for ErrCode at stream to not lose former work.
+ // This may contain important information and will behave the
+ // same as before. When we have an error, do not create content
+ ErrCode aErrCode(pStream->GetError());
- bReadError = aErrCode.IsError();
+ bReadError = aErrCode.IsError();
+ }
+ }
+ catch (...)
+ {
+ bReadError = true;
}
pStream->SetEndian(nOrigNumberFormat);