diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-05-16 15:24:04 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-05-16 15:24:52 +0200 |
commit | 30590f00e44cbe7b2a5253f544302ee5b0c3c08d (patch) | |
tree | b0b382a03d419262e61ca4f8d7e376e11678c40e /libvisio | |
parent | 60618628682d0308c3aa46cd2074fca6a0512ace (diff) |
Let VSD typedetection not throw
Change-Id: Ifdb4cff2e2cbc05b694db31fcaf381186ec1b830
Diffstat (limited to 'libvisio')
-rw-r--r-- | libvisio/libvisio-0.0.16-nothrow.patch | 31 | ||||
-rw-r--r-- | libvisio/makefile.mk | 1 |
2 files changed, 32 insertions, 0 deletions
diff --git a/libvisio/libvisio-0.0.16-nothrow.patch b/libvisio/libvisio-0.0.16-nothrow.patch new file mode 100644 index 000000000000..42b8efebe5d2 --- /dev/null +++ b/libvisio/libvisio-0.0.16-nothrow.patch @@ -0,0 +1,31 @@ +--- misc/libvisio-0.0.16/src/lib/VisioDocument.cpp 2012-04-13 10:54:19.000000000 +0200 ++++ misc/build/libvisio-0.0.16/src/lib/VisioDocument.cpp 2012-05-16 15:16:08.974375389 +0200 +@@ -45,10 +45,13 @@ + */ + bool libvisio::VisioDocument::isSupported(WPXInputStream *input) + { ++ WPXInputStream *tmpDocStream = 0; ++ try ++ { + input->seek(0, WPX_SEEK_SET); + if (!input->isOLEStream()) + return false; +- WPXInputStream *tmpDocStream = input->getDocumentOLEStream("VisioDocument"); ++ tmpDocStream = input->getDocumentOLEStream("VisioDocument"); + if (!tmpDocStream) + return false; + +@@ -64,6 +67,13 @@ + { + return true; + } ++ } ++ catch (...) ++ { ++ if (tmpDocStream) ++ delete tmpDocStream; ++ return false; ++ } + + return false; + } diff --git a/libvisio/makefile.mk b/libvisio/makefile.mk index f42891856980..2a1be7eaa1e5 100644 --- a/libvisio/makefile.mk +++ b/libvisio/makefile.mk @@ -58,6 +58,7 @@ TARFILE_NAME=libvisio-0.0.16 TARFILE_MD5=2fa6028324347860e684e75310818d43 PATCH_FILES=\ + $(TARFILE_NAME)-nothrow.patch \ $(TARFILE_NAME).patch |