diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-05-16 15:24:04 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-05-16 14:59:42 +0100 |
commit | 662457e973b8f35eb65808095e57949b41c72e8a (patch) | |
tree | 01d57a6e6e555eb3069c019296efd1784ada10c6 | |
parent | fcac9e82d3233d85a6da11bd716a7dc357d5eed2 (diff) |
Let VSD typedetection not throw
Change-Id: Ifdb4cff2e2cbc05b694db31fcaf381186ec1b830
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
-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 |