Kaydet (Commit) 30590f00 authored tarafından Fridrich Štrba's avatar Fridrich Štrba

Let VSD typedetection not throw

Change-Id: Ifdb4cff2e2cbc05b694db31fcaf381186ec1b830
üst 60618628
--- 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;
}
...@@ -58,6 +58,7 @@ TARFILE_NAME=libvisio-0.0.16 ...@@ -58,6 +58,7 @@ TARFILE_NAME=libvisio-0.0.16
TARFILE_MD5=2fa6028324347860e684e75310818d43 TARFILE_MD5=2fa6028324347860e684e75310818d43
PATCH_FILES=\ PATCH_FILES=\
$(TARFILE_NAME)-nothrow.patch \
$(TARFILE_NAME).patch $(TARFILE_NAME).patch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment