summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2012-03-19 01:12:01 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-03-19 01:12:01 +0100
commitf1f13a69a0f47db35409dcccf742e8e8f5ae240c (patch)
tree58dd48cd3d05913f7cf2927d40498a62b36fe29c
parentca4e58af69a4a74bc73fd6b5b8c7ae158122bdf0 (diff)
A bit more of sanity
-rw-r--r--src/lib/VisioDocument.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/VisioDocument.cpp b/src/lib/VisioDocument.cpp
index d193ddd..ee87c6a 100644
--- a/src/lib/VisioDocument.cpp
+++ b/src/lib/VisioDocument.cpp
@@ -45,6 +45,9 @@ stream is a Visio Document that libvisio able to parse
*/
bool libvisio::VisioDocument::isSupported(WPXInputStream *input)
{
+ input->seek(0, WPX_SEEK_SET);
+ if (!input->isOLEStream())
+ return false;
WPXInputStream *tmpDocStream = input->getDocumentOLEStream("VisioDocument");
if (!tmpDocStream)
return false;
@@ -75,6 +78,9 @@ WPGPaintInterface class implementation when needed. This is often commonly calle
*/
bool libvisio::VisioDocument::parse(::WPXInputStream *input, libwpg::WPGPaintInterface *painter)
{
+ input->seek(0, WPX_SEEK_SET);
+ if (!input->isOLEStream())
+ return false;
WPXInputStream *docStream = input->getDocumentOLEStream("VisioDocument");
if (!docStream)
{