summaryrefslogtreecommitdiff
path: root/libvisio/libvisio-0.0.16-nothrow.patch
diff options
context:
space:
mode:
Diffstat (limited to 'libvisio/libvisio-0.0.16-nothrow.patch')
-rw-r--r--libvisio/libvisio-0.0.16-nothrow.patch31
1 files changed, 31 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;
+ }