[Libreoffice-commits] libcdr.git: 4 commits - .gitignore HACKING Makefile.am src/lib

David Tardon dtardon at redhat.com
Mon Aug 3 08:21:27 PDT 2015


 .gitignore            |    1 +
 HACKING               |    2 +-
 Makefile.am           |    2 ++
 src/lib/CDRParser.cpp |    5 +++--
 src/lib/CDRTypes.cpp  |    2 +-
 5 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 847ed41df0cd654568699e57c88c8d4849af8007
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Aug 3 17:15:40 2015 +0200

    afl: avoid loops when parsing waldo structure
    
    Change-Id: I9737af9453ab01ab5e121ac705eea5ba5663245b

diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp
index f3e4aeb..628f4e7 100644
--- a/src/lib/CDRParser.cpp
+++ b/src/lib/CDRParser.cpp
@@ -338,7 +338,8 @@ bool libcdr::CDRParser::gatherWaldoInformation(librevenge::RVNGInputStream *inpu
 bool libcdr::CDRParser::parseWaldoStructure(librevenge::RVNGInputStream *input, std::stack<WaldoRecordType1> &waldoStack,
                                             const std::map<unsigned, WaldoRecordType1> &records1, std::map<unsigned, WaldoRecordInfo> &records2)
 {
-  while (!waldoStack.empty())
+  std::set<unsigned> visited;
+  while (!waldoStack.empty() && visited.insert(waldoStack.top().m_id).second)
   {
     m_collector->collectBBox(waldoStack.top().m_x0, waldoStack.top().m_y0, waldoStack.top().m_x1, waldoStack.top().m_y1);
     std::map<unsigned, WaldoRecordType1>::const_iterator iter1;
@@ -377,7 +378,7 @@ bool libcdr::CDRParser::parseWaldoStructure(librevenge::RVNGInputStream *input,
       waldoStack.top() = iter1->second;
     }
   }
-  return true;
+  return waldoStack.empty();
 }
 
 void libcdr::CDRParser::readWaldoRecord(librevenge::RVNGInputStream *input, const WaldoRecordInfo &info)
commit 4c814c054885be4e31d275eac76e96d7e2c66d0f
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Aug 3 15:20:29 2015 +0200

    afl: avoid division by 0
    
    Change-Id: I5ead8ab028a3bc950a39a4afd3e5b5d67977d540

diff --git a/src/lib/CDRTypes.cpp b/src/lib/CDRTypes.cpp
index 71cb4d9..0e57f89 100644
--- a/src/lib/CDRTypes.cpp
+++ b/src/lib/CDRTypes.cpp
@@ -15,7 +15,7 @@ void libcdr::CDRPolygon::create(libcdr::CDRPath &path) const
 {
   libcdr::CDRPath tmpPath(path);
   double step = 2*M_PI / (double)m_numAngles;
-  if (m_numAngles % m_nextPoint)
+  if (m_nextPoint && m_numAngles % m_nextPoint)
   {
     libcdr::CDRTransform tmpTrafo(cos(m_nextPoint*step), sin(m_nextPoint*step), 0.0, -sin(m_nextPoint*step), cos(m_nextPoint*step), 0.0);
     for (unsigned i = 1; i < m_numAngles; ++i)
commit c324241165636572270b23427100237b021f91cc
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Aug 3 17:16:21 2015 +0200

    add make astyle target
    
    Change-Id: I35859b9856f61c8aee36926f97d80847a5b54eef

diff --git a/HACKING b/HACKING
index 4f02df4..5d8d713 100644
--- a/HACKING
+++ b/HACKING
@@ -3,6 +3,6 @@
 This project uses mostly the same file naming and coding style like
 libwpd and the rest of Fridrich's libraries. Please run
 
-    astyle --options=astyle.options \*.cpp \*.h
+    make astyle
 
 before committing.
diff --git a/Makefile.am b/Makefile.am
index 2205c30..f7041e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,3 +30,5 @@ zip: all install
 dist-hook:
 	git log --date=short --pretty="format:@%cd  %an  <%ae>  [%H]%n%n%s%n%n%e%b" | sed -e "s|^\([^@]\)|\t\1|" -e "s|^@||" >$(distdir)/ChangeLog
 
+astyle:
+	astyle --options=astyle.options \*.cpp \*.h
commit d69481c8a80ae46bc5a02441a926243627e3b7da
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Aug 3 15:38:13 2015 +0200

    add tags to .gitignore
    
    Change-Id: I4754b1b6c570902ccb83f9d91a0a1967c6d6a5d1

diff --git a/.gitignore b/.gitignore
index 849a084..60fdb73 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,7 @@ m4
 missing
 mkinstalldirs
 stamp-h1
+tags
 *.pc
 *.rc
 *~


More information about the Libreoffice-commits mailing list