summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-07-29 18:19:10 +0200
committerDavid Tardon <dtardon@redhat.com>2014-07-29 18:19:52 +0200
commitecd8101f3dd47a01c57e6e1e2c8f72aa31993358 (patch)
treeeae82a7347e4fcb283a7d5a5127169154b07c00f
parent1700911d88f56c077ca1b49d7c07489a059ed0da (diff)
check arguments
Change-Id: I23cf6e3c04100ec021f913171bb469a221515584
-rw-r--r--src/lib/VisioDocument.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/VisioDocument.cpp b/src/lib/VisioDocument.cpp
index be14b68..951fb28 100644
--- a/src/lib/VisioDocument.cpp
+++ b/src/lib/VisioDocument.cpp
@@ -322,6 +322,9 @@ stream is a Visio Document that libvisio able to parse
*/
VSDAPI bool libvisio::VisioDocument::isSupported(librevenge::RVNGInputStream *input)
{
+ if (!input)
+ return false;
+
if (isBinaryVisioDocument(input))
return true;
if (isOpcVisioDocument(input))
@@ -341,6 +344,9 @@ librevenge::RVNGDrawingInterface class implementation when needed. This is often
*/
VSDAPI bool libvisio::VisioDocument::parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
{
+ if (!input || !painter)
+ return false;
+
if (isBinaryVisioDocument(input))
{
if (parseBinaryVisioDocument(input, painter, false))
@@ -372,6 +378,9 @@ when needed.
*/
VSDAPI bool libvisio::VisioDocument::parseStencils(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
{
+ if (!input || !painter)
+ return false;
+
if (isBinaryVisioDocument(input))
{
if (parseBinaryVisioDocument(input, painter, true))