[Libreoffice-commits] libmspub.git: src/lib

David Tardon dtardon at redhat.com
Tue Jul 29 09:15:58 PDT 2014


 src/lib/MSPUBDocument.cpp |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 0909d5efcdc948ab455e14f718114c53fd8f52bc
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Jul 29 18:12:01 2014 +0200

    check input
    
    Change-Id: I117ffe49fd6be34b07b094f0671244500ab44a53

diff --git a/src/lib/MSPUBDocument.cpp b/src/lib/MSPUBDocument.cpp
index 7ec0d22..452b6eb 100644
--- a/src/lib/MSPUBDocument.cpp
+++ b/src/lib/MSPUBDocument.cpp
@@ -84,6 +84,9 @@ stream is a Microsoft Publisher Document that libmspub is able to parse
 */
 PUBAPI bool MSPUBDocument::isSupported(librevenge::RVNGInputStream *input)
 {
+  if (!input)
+    return false;
+
   try
   {
     MSPUBVersion version = getVersion(input);
@@ -117,6 +120,9 @@ RVNGDrawingInterface class implementation when needed. This is often commonly ca
 */
 PUBAPI bool MSPUBDocument::parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
 {
+  if (!input || !painter)
+    return false;
+
   try
   {
     MSPUBCollector collector(painter);


More information about the Libreoffice-commits mailing list