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

David Tardon dtardon at redhat.com
Mon Jun 2 09:52:37 PDT 2014


 src/lib/MSPUBParser.cpp    |    3 ++-
 src/lib/libmspub_utils.cpp |    6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit e0da5267d2a86360731f848130ac500419fac0fd
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Jun 2 18:41:39 2014 +0200

    coverity#1132886 missing break in switch
    
    Change-Id: I93facc400851d4ec698769a4bc665859b0fa0245

diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp
index 7e44665..e0f70d3 100644
--- a/src/lib/MSPUBParser.cpp
+++ b/src/lib/MSPUBParser.cpp
@@ -2369,6 +2369,7 @@ libmspub::MSPUBBlockInfo libmspub::MSPUBParser::parseBlock(librevenge::RVNGInput
     case 24:
       //FIXME: Not doing anything with this data for now.
       skipBlock(input, info);
+    // fall-through intended
     default:
       info.data = 0;
     }
commit 0af593e3b4bdfcc016a54acd53c56ed303ef476d
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Jun 2 17:12:45 2014 +0200

    const_cast is no longer necessary
    
    Change-Id: I8573498decad389693da324f7e3132e91fc71bb8

diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp
index 40e7589..7e44665 100644
--- a/src/lib/MSPUBParser.cpp
+++ b/src/lib/MSPUBParser.cpp
@@ -251,7 +251,7 @@ bool libmspub::MSPUBParser::parseEscherDelay(librevenge::RVNGInputStream *input)
       {
         // Reconstruct BMP header
         // cf. http://en.wikipedia.org/wiki/BMP_file_format , accessed 2012-5-31
-        librevenge::RVNGInputStream *buf = const_cast<librevenge::RVNGInputStream *>(img.getDataStream());
+        librevenge::RVNGInputStream *buf = img.getDataStream();
         if (img.size() < 0x2E + 4)
         {
           ++m_lastAddedImage;
commit 6fb847a013c351af04125b4c7e5a9aaab861afde
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Jun 2 17:10:32 2014 +0200

    coverity#1219715 dereference after null check
    
    Change-Id: I36ddbef50da52dcf1e22b47d94a759606fd818a2

diff --git a/src/lib/libmspub_utils.cpp b/src/lib/libmspub_utils.cpp
index 9749902..3628e14 100644
--- a/src/lib/libmspub_utils.cpp
+++ b/src/lib/libmspub_utils.cpp
@@ -255,7 +255,11 @@ uint8_t libmspub::readU8(librevenge::RVNGInputStream *input)
 {
   if (!input || input->isEnd())
   {
-    MSPUB_DEBUG_MSG(("Something bad happened here!Tell: %ld\n", input->tell()));
+    MSPUB_DEBUG_MSG(("Something bad happened here!"));
+    if (input)
+    {
+      MSPUB_DEBUG_MSG((" Tell: %ld\n", input->tell()));
+    }
     throw EndOfStreamException();
   }
   unsigned long numBytesRead;


More information about the Libreoffice-commits mailing list