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

David Tardon dtardon at redhat.com
Tue Jun 20 10:28:35 UTC 2017


 src/lib/CDRParser.cpp |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 04bd2943cc3a5e16736dd96a8c87852b82fe2983
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Jun 20 12:26:53 2017 +0200

    ofz#2246 avoid division by 0
    
    Change-Id: Ieb643d124e3d934ee2f1c9e12d3e6e532a9dfc50

diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp
index 617dea6..ba14393 100644
--- a/src/lib/CDRParser.cpp
+++ b/src/lib/CDRParser.cpp
@@ -1172,8 +1172,12 @@ void libcdr::CDRParser::readRectangle(librevenge::RVNGInputStream *input)
   }
   else
   {
-    scaleX = readDouble(input);
-    scaleY = readDouble(input);
+    double scale = readDouble(input);
+    if (scale != 0)
+      scaleX = scale;
+    scale = readDouble(input);
+    if (scale != 0)
+      scaleY = scale;
     unsigned int scale_with = readU8(input);
     input->seek(7, librevenge::RVNG_SEEK_CUR);
     if (scale_with == 0)


More information about the Libreoffice-commits mailing list