[Libreoffice-commits] .: Branch 'libreoffice-3-6' - libcdr/libcdr-issupported-exception.patch.1 libcdr/makefile.mk
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Jan 7 01:23:42 PST 2013
libcdr/libcdr-issupported-exception.patch.1 | 42 ++++++++++++++++++++++++++++
libcdr/makefile.mk | 2 +
2 files changed, 44 insertions(+)
New commits:
commit 2a87fd704edfea351b238ef4103ae36927f2b860
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jan 4 23:44:38 2013 +0100
rhbz#891082: CMXDocument::isSupported: catch exceptions
(cherry picked from commit 374f7465729c98f2cc8af72f876a8eab01d192a6)
Conflicts:
libcdr/UnpackedTarball_cdr.mk
Change-Id: I715975dfa93d736cb537076feab4afe6b75c162a
Reviewed-on: https://gerrit.libreoffice.org/1547
Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
diff --git a/libcdr/libcdr-issupported-exception.patch.1 b/libcdr/libcdr-issupported-exception.patch.1
new file mode 100644
index 0000000..4196c46
--- /dev/null
+++ b/libcdr/libcdr-issupported-exception.patch.1
@@ -0,0 +1,42 @@
+rhbz#891082: CMXDocument::isSupported: catch exceptions
+
+--- misc/libcdr-0.0.9/src/lib/CMXDocument.cpp
++++ misc/build/libcdr-0.0.9/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;
+ }
+
diff --git a/libcdr/makefile.mk b/libcdr/makefile.mk
index 0a8df79..2ede985 100755
--- a/libcdr/makefile.mk
+++ b/libcdr/makefile.mk
@@ -62,6 +62,8 @@ INCPRE+=$(SOLARVER)$/$(INPATH)$/inc$/lcms2
TARFILE_NAME=libcdr-0.0.9
TARFILE_MD5=3c0037fb07dea2f0bbae8386fa7c6a9a
+PATCH_FILES=libcdr-issupported-exception.patch.1
+
BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS)
BUILD_DIR=src$/lib
More information about the Libreoffice-commits
mailing list