[Libreoffice-commits] .: Branch 'libreoffice-4-0' - 2 commits - libcdr/libcdr-issupported-exception.patch.1 libcdr/UnpackedTarball_cdr.mk sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 4 15:06:24 PST 2013


 libcdr/UnpackedTarball_cdr.mk               |    1 
 libcdr/libcdr-issupported-exception.patch.1 |   43 ++++++++++++++++++++++++++++
 sw/source/ui/uno/unotxdoc.cxx               |    5 ++-
 3 files changed, 48 insertions(+), 1 deletion(-)

New commits:
commit 6738ae52bd075dc6478dedfeddc60d1c25cffcb2
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jan 4 23:44:38 2013 +0100

    rhbz#891082: CMXDocument::isSupported: catch exceptions
    
    Change-Id: I715975dfa93d736cb537076feab4afe6b75c162a
    (cherry picked from commit 374f7465729c98f2cc8af72f876a8eab01d192a6)

diff --git a/libcdr/UnpackedTarball_cdr.mk b/libcdr/UnpackedTarball_cdr.mk
index 3b02022..b8b6726 100644
--- a/libcdr/UnpackedTarball_cdr.mk
+++ b/libcdr/UnpackedTarball_cdr.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,cdr,1))
 
 $(eval $(call gb_UnpackedTarball_add_patches,cdr,\
 	libcdr/libcdr-configure.patch.1 \
+	libcdr/libcdr-issupported-exception.patch.1 \
 	libcdr/libcdr-msvc.patch \
 ))
 
diff --git a/libcdr/libcdr-issupported-exception.patch.1 b/libcdr/libcdr-issupported-exception.patch.1
new file mode 100644
index 0000000..ee4ecec
--- /dev/null
+++ b/libcdr/libcdr-issupported-exception.patch.1
@@ -0,0 +1,43 @@
+rhbz#891082: CMXDocument::isSupported: catch exceptions
+
+diff -ru cdr.old/src/lib/CMXDocument.cpp cdr/src/lib/CMXDocument.cpp
+--- cdr.old/src/lib/CMXDocument.cpp
++++ cdr/src/lib/CMXDocument.cpp
+@@ -46,20 +46,24 @@
+ */
+ bool libcdr::CMXDocument::isSupported(WPXInputStream *input)
+ {
+-  input->seek(0, WPX_SEEK_SET);
+-  unsigned riff = readU32(input);
+-  if (riff != FOURCC_RIFF && riff != FOURCC_RIFX)
+-    return false;
+-  input->seek(4, WPX_SEEK_CUR);
+-  char signature_c = (char)readU8(input);
+-  if (signature_c != 'C' && signature_c != 'c')
+-    return false;
+-  char signature_d = (char)readU8(input);
+-  if (signature_d != 'M' && signature_d != 'm')
+-    return false;
+-  char signature_r = (char)readU8(input);
+-  if (signature_r != 'X' && signature_r != 'x')
++  try {
++    input->seek(0, WPX_SEEK_SET);
++    unsigned riff = readU32(input);
++    if (riff != FOURCC_RIFF && riff != FOURCC_RIFX)
++      return false;
++    input->seek(4, WPX_SEEK_CUR);
++    char signature_c = (char)readU8(input);
++    if (signature_c != 'C' && signature_c != 'c')
++      return false;
++    char signature_d = (char)readU8(input);
++    if (signature_d != 'M' && signature_d != 'm')
++      return false;
++    char signature_r = (char)readU8(input);
++    if (signature_r != 'X' && signature_r != 'x')
++      return false;
++  } catch (...) {
+     return false;
++  }
+   return true;
+ }
+ 
commit 36371917258bd66c29e1ac15f68df3aea0288151
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jan 4 22:27:22 2013 +0100

    rhbz#890080: crash in SwXTextDocument::getRendererCount
    
    No idea how to reproduce it; pSwView is checked before use except here.
    (possibly regression from 2f9f480b22f2fff59d9c48b4b46706c3d5223e66)
    
    Change-Id: Ia7667e879a6944e084a45c06133efc1ac2d8b3c0
    (cherry picked from commit 1c52268a5bc6d79c6ee1344e4e341c7e3820d4e0)

diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 2c26127..ceca233 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -2533,7 +2533,10 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
                 SwViewOption aOpt( *pViewShell->GetViewOptions() );
                 aOpt.setBrowseMode( false );
                 pViewShell->ApplyViewOptions( aOpt );
-                pSwView->RecheckBrowseMode();
+                if (pSwView)
+                {
+                    pSwView->RecheckBrowseMode();
+                }
             }
 
             // reformating the document for printing will show the changes in the view


More information about the Libreoffice-commits mailing list