emfio/source/emfuno/xemfparser.cxx | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)
New commits: commit d8b4d2f9c6fe710031471bea360e9223f29c3eea Author: Caolán McNamara <[email protected]> AuthorDate: Tue Sep 11 21:18:41 2018 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Wed Sep 12 09:57:44 2018 +0200 ofz#10301 Abrt Change-Id: I3ec766dd243fa27068ec44b16c941beaa9da1479 Reviewed-on: https://gerrit.libreoffice.org/60359 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> 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); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
