Hello community,
here is the log from the commit of package libcdr for openSUSE:Factory checked in at 2014-12-03 22:49:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libcdr (Old)
and /work/SRC/openSUSE:Factory/.libcdr.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libcdr"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libcdr/libcdr.changes 2014-07-27 18:47:07.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libcdr.new/libcdr.changes 2014-12-03 22:49:45.000000000 +0100
@@ -1,0 +2,13 @@
+Fri Nov 28 08:43:28 UTC 2014 - fstrba@suse.com
+
+- Upgrade to upstream version 0.1.1
+ * Fix several problems found by Coverity.
+ * Fix crash when NULL is passed as input stream.
+ * Fix various crashes and hangs when reading broken files found
+ with the help of american-fuzzy-lop.
+ * Only export public symbols on Linux.
+- Remove patch: libcdr-0.1.0-pkgconfig.patch
+- Add patch: libcdr-0.1.1-pkgconfig.patch
+ * Rediff to apply to current context
+
+-------------------------------------------------------------------
Old:
----
libcdr-0.1.0-pkgconfig.patch
libcdr-0.1.0.tar.xz
New:
----
libcdr-0.1.1-pkgconfig.patch
libcdr-0.1.1.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libcdr.spec ++++++
--- /var/tmp/diff_new_pack.YWA65R/_old 2014-12-03 22:49:47.000000000 +0100
+++ /var/tmp/diff_new_pack.YWA65R/_new 2014-12-03 22:49:47.000000000 +0100
@@ -18,7 +18,7 @@
%define libname libcdr-0_1-1
Name: libcdr
-Version: 0.1.0
+Version: 0.1.1
Release: 0
Summary: Library for parsing the Corel Draw file format structure
License: MPL-2.0
@@ -26,7 +26,7 @@
Url: http://www.freedesktop.org/wiki/Software/libcdr
Source0: http://dev-www.libreoffice.org/src/%{name}/%{name}-%{version}.tar.xz
# note: the main package is empty, it only sets a sane name for the source rpm
-Patch0: libcdr-0.1.0-pkgconfig.patch
+Patch0: libcdr-0.1.1-pkgconfig.patch
BuildRequires: boost-devel
BuildRequires: doxygen
BuildRequires: fdupes
++++++ libcdr-0.1.0-pkgconfig.patch -> libcdr-0.1.1-pkgconfig.patch ++++++
--- /work/SRC/openSUSE:Factory/libcdr/libcdr-0.1.0-pkgconfig.patch 2014-07-27 18:47:07.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libcdr.new/libcdr-0.1.1-pkgconfig.patch 2014-12-03 22:49:45.000000000 +0100
@@ -1,7 +1,7 @@
---- libcdr-0.1.0/libcdr.pc.in 2014-04-16 19:06:20.000000000 +0200
-+++ libcdr-0.1.0/libcdr.pc.in 2014-07-25 09:14:23.096910474 +0200
+--- libcdr-0.1.1/libcdr.pc.in 2014-04-16 19:06:20.000000000 +0200
++++ libcdr-0.1.1/libcdr.pc.in 2014-07-25 09:14:23.096910474 +0200
@@ -9,5 +9,3 @@
- Requires: librevenge-0.0 librevenge-stream-0.0
+ Requires: librevenge-0.0
Libs: -L${libdir} -lcdr-@CDR_MAJOR_VERSION@.@CDR_MINOR_VERSION@
Cflags: -I${includedir}/libcdr-@CDR_MAJOR_VERSION@.@CDR_MINOR_VERSION@
-
++++++ libcdr-0.1.0.tar.xz -> libcdr-0.1.1.tar.xz ++++++
++++ 2555 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/ChangeLog new/libcdr-0.1.1/ChangeLog
--- old/libcdr-0.1.0/ChangeLog 2014-05-23 17:05:41.000000000 +0200
+++ new/libcdr-0.1.1/ChangeLog 2014-11-24 15:04:01.000000000 +0100
@@ -1,3 +1,102 @@
+2014-11-24 David Tardon [06f9844bd62f718bed85ca74d3769f73b5b9b2ab]
+
+ prepare for a release
+
+ Change-Id: I4d02133381c7cad26f2fabb25eb1abb6d1b10992
+
+2014-11-24 David Tardon [d8f9b82f345e3f22b440e17e58adfc23a40ee6a0]
+
+ only export public symbols
+
+ Change-Id: I0688bcb1742b0459db599517ebe50e45495a1bad
+
+2014-11-21 David Tardon [6d7de600e938543448f680cc840211f52bb0b848]
+
+ avoid extra big allocation, continued
+
+ Change-Id: I6cf7c2535e1a4b8163413c1826535b856587bc00
+
+2014-11-21 David Tardon [bc3c34481e731d2e696498d19ad5d15b5658afb8]
+
+ avoid extra big allocation, continued
+
+ Change-Id: I0e277d9cb47d9e6bf007b7a4668be339f2884b25
+
+2014-11-20 David Tardon [2a5b92b43336c3e0b82ffad6b06b8623d7007761]
+
+ optimize repeated seeks
+
+ This speeds up parsing of a pathological case of a broken file from
+ 0m29.644s to 0m0.028s.
+
+ Change-Id: I438d8d3bfd84d3d52e8de18b2680a43948cda3ed
+
+2014-11-20 David Tardon [d08b5c8a09190852e21f8a2ae4b1720f13dbfbc4]
+
+ avoid extra big allocation
+
+ Change-Id: Ibb22de59d17a85e8b0a8df8be277643fc9ba7f52
+
+2014-11-20 David Tardon [983bc0a2e969b011760956d739260a181001a855]
+
+ deinit z_stream properly if reading from input fails
+
+ Change-Id: I5a2ce38daf8f251029ccf8c1458025f950fe2af2
+
+2014-11-20 David Tardon [1d605d21e7b5f87c1ad18ff2e7dc03a092a6e557]
+
+ avoid out-of-bounds read
+
+ Change-Id: I6b43ce6e7160789bdd99aabf8632bfc3431d4b7d
+
+2014-11-20 David Tardon [629dadcd8002d077fdd4f30d4e7f156b03e644f8]
+
+ nothing to do here if there's no bitmap data to read
+
+ Change-Id: I07d1540d44dc97d7fbb88db363123cb28b7d812d
+
+2014-11-20 David Tardon [4a1be786ced3083a9a609e4aa2af9bc5b89ec21e]
+
+ avoid out-of-bounds read
+
+ Change-Id: I5510b80b9c6d1512f2e6e8bb25f48fb0bcded515
+
+2014-07-29 David Tardon [88b4e8b39c3c187e2262786d469b0a9d9e2eae9d]
+
+ check arguments
+
+ Change-Id: I62f5abfe8f954f9825befcad589ded09ae8f7700
+
+2014-07-03 David Tardon [9a46ea9577d72f5e9f2eef6c74401bc7c33e3f79]
+
+ clang: value stored to input is never read
+
+ Change-Id: I50aeae903940a5ce3acfd9b5e3276fddf8aef584
+
+2014-06-03 David Tardon [6448d30053f59f1b71cd841629d053f6bf071d82]
+
+ coverity#1219654 avoid possible out-of-bounds access
+
+ Change-Id: I44de7037a9e3a65b539f452aace782683121ba83
+
+2014-06-03 David Tardon [b29f874bb1e8c15b2c77e094d4431a59662e0283]
+
+ coverity#1219811 dereference null return value
+
+ Change-Id: I2cff394e32ce6bc7bf39fae09d91a9730ad8f656
+
+2014-06-03 David Tardon [f8c8a0d09c0614d7b0794b09b5d3fcaba84294b1]
+
+ the const_cast is no longer necessary
+
+ Change-Id: I802fd594660761e5ee112fa096f6f4c8fcc97cbb
+
+2014-05-27 Fridrich Štrba [e973b9db65df3c367e09e0d4623be59a91074515]
+
+ The library strictly speaking does not need the stream implementations
+
+ Change-Id: I2787a6fa4b1d934c0ecd96d4e4ebb71cfc742511
+
2014-05-23 David Tardon [56003faa885246a43d2117856f54bb89326b1668]
prepare for a new release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/NEWS new/libcdr-0.1.1/NEWS
--- old/libcdr-0.1.0/NEWS 2014-05-23 17:03:48.000000000 +0200
+++ new/libcdr-0.1.1/NEWS 2014-11-24 15:02:39.000000000 +0100
@@ -1,3 +1,11 @@
+libcdr 0.1.1
+
+* Fix several problems found by Coverity.
+* Fix crash when NULL is passed as input stream.
+* Fix various crashes and hangs when reading broken files found with the
+ help of american-fuzzy-lop.
+* Only export public symbols on Linux.
+
libcdr 0.1.0
* switch to librevenge
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/compile new/libcdr-0.1.1/compile
--- old/libcdr-0.1.0/compile 1970-01-01 01:00:00.000000000 +0100
+++ new/libcdr-0.1.1/compile 2014-11-20 15:21:41.000000000 +0100
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey .
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to or send patches to
+# .
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" "" $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv/,$2, in
+ *,$file_conv,*)
+ ;;
+ mingw/*)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin/*)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine/*)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+ # Assume a capable shell
+ lib_path=
+ shared=:
+ linker_opts=
+ for arg
+ do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ eat=1
+ case $2 in
+ *.o | *.[oO][bB][jJ])
+ func_file_conv "$2"
+ set x "$@" -Fo"$file"
+ shift
+ ;;
+ *)
+ func_file_conv "$2"
+ set x "$@" -Fe"$file"
+ shift
+ ;;
+ esac
+ ;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -I*)
+ func_file_conv "${1#-I}" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -l*)
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
+ -L*)
+ func_cl_dashL "${1#-L}"
+ ;;
+ -static)
+ shared=false
+ ;;
+ -Wl,*)
+ arg=${1#-Wl,}
+ save_ifs="$IFS"; IFS=','
+ for flag in $arg; do
+ IFS="$save_ifs"
+ linker_opts="$linker_opts $flag"
+ done
+ IFS="$save_ifs"
+ ;;
+ -Xlinker)
+ eat=1
+ linker_opts="$linker_opts $2"
+ ;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+ func_file_conv "$1" mingw
+ set x "$@" "$file"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+ done
+ if test -n "$linker_opts"; then
+ linker_opts="-link$linker_opts"
+ fi
+ exec "$@" $linker_opts
+ exit 1
+}
+
+eat=
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to .
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ func_cl_wrapper "$@" # Doesn't return...
+ ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no '-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # '.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/configure.ac new/libcdr-0.1.1/configure.ac
--- old/libcdr-0.1.0/configure.ac 2014-03-29 11:23:47.000000000 +0100
+++ new/libcdr-0.1.1/configure.ac 2014-11-24 14:55:50.000000000 +0100
@@ -7,7 +7,7 @@
# ====================
m4_define([libcdr_version_major],[0])
m4_define([libcdr_version_minor],[1])
-m4_define([libcdr_version_micro],[0])
+m4_define([libcdr_version_micro],[1])
m4_define([libcdr_version],[libcdr_version_major.libcdr_version_minor.libcdr_version_micro])
# =============
@@ -39,7 +39,7 @@
# Find librevenge
# ===============
PKG_CHECK_MODULES([REVENGE],[
- librevenge-0.0
+ librevenge-0.0 >= 0.0.1
])
AC_SUBST([REVENGE_CFLAGS])
AC_SUBST([REVENGE_LIBS])
@@ -184,6 +184,25 @@
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL([PLATFORM_WIN32], [test "x$platform_win32" = "xyes"])
+AS_IF([test $platform_win32 == yes],
+ [],
+ [
+ AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
+ saved_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+ AC_TRY_COMPILE([], [],
+ [
+ AC_MSG_RESULT([yes])
+ CXXFLAGS="$CXXFLAGS -DLIBCDR_VISIBILITY"
+ ],
+ [
+ AC_MSG_RESULT([no])
+ CXXFLAGS="$saved_CXXFLAGS"
+ ]
+ )
+ ]
+)
+
# ================
# Check for cflags
# ================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/inc/libcdr/libcdr_api.h new/libcdr-0.1.1/inc/libcdr/libcdr_api.h
--- old/libcdr-0.1.0/inc/libcdr/libcdr_api.h 2014-03-29 11:23:47.000000000 +0100
+++ new/libcdr-0.1.1/inc/libcdr/libcdr_api.h 2014-11-24 14:51:00.000000000 +0100
@@ -16,9 +16,13 @@
#else
#define CDRAPI __declspec(dllimport)
#endif
+#else // !DLL_EXPORT
+#ifdef LIBCDR_VISIBILITY
+#define CDRAPI __attribute__((visibility("default")))
#else
#define CDRAPI
#endif
+#endif
#endif
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/libcdr.pc.in new/libcdr-0.1.1/libcdr.pc.in
--- old/libcdr-0.1.0/libcdr.pc.in 2014-04-16 19:06:20.000000000 +0200
+++ new/libcdr-0.1.1/libcdr.pc.in 2014-07-29 18:23:00.000000000 +0200
@@ -6,7 +6,7 @@
Name: libcdr-@CDR_MAJOR_VERSION@.@CDR_MINOR_VERSION@
Description: Library for parsing the Corel Draw file format structure
Version: @VERSION@
-Requires: librevenge-0.0 librevenge-stream-0.0
+Requires: librevenge-0.0
Libs: -L${libdir} -lcdr-@CDR_MAJOR_VERSION@.@CDR_MINOR_VERSION@
Cflags: -I${includedir}/libcdr-@CDR_MAJOR_VERSION@.@CDR_MINOR_VERSION@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/libcdr.spec new/libcdr-0.1.1/libcdr.spec
--- old/libcdr-0.1.0/libcdr.spec 2014-05-23 17:04:50.000000000 +0200
+++ new/libcdr-0.1.1/libcdr.spec 2014-11-24 15:04:01.000000000 +0100
@@ -1,5 +1,5 @@
%define name libcdr
-%define version 0.1.0
+%define version 0.1.1
%define RELEASE 1
%define release %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/src/lib/CDRContentCollector.cpp new/libcdr-0.1.1/src/lib/CDRContentCollector.cpp
--- old/libcdr-0.1.0/src/lib/CDRContentCollector.cpp 2014-04-10 12:41:50.000000000 +0200
+++ new/libcdr-0.1.1/src/lib/CDRContentCollector.cpp 2014-07-29 18:23:00.000000000 +0200
@@ -1185,7 +1185,10 @@
void libcdr::CDRContentCollector::collectVectorPattern(unsigned id, const librevenge::RVNGBinaryData &data)
{
- librevenge::RVNGInputStream *input = const_cast(data.getDataStream());
+ librevenge::RVNGInputStream *input = data.getDataStream();
+ if (!input)
+ return;
+
input->seek(0, librevenge::RVNG_SEEK_SET);
if (!libcdr::CMXDocument::isSupported(input))
return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/src/lib/CDRDocument.cpp new/libcdr-0.1.1/src/lib/CDRDocument.cpp
--- old/libcdr-0.1.0/src/lib/CDRDocument.cpp 2014-03-29 11:23:47.000000000 +0100
+++ new/libcdr-0.1.1/src/lib/CDRDocument.cpp 2014-07-29 18:23:00.000000000 +0200
@@ -61,6 +61,9 @@
*/
CDRAPI bool libcdr::CDRDocument::isSupported(librevenge::RVNGInputStream *input)
{
+ if (!input)
+ return false;
+
librevenge::RVNGInputStream *tmpInput = input;
try
{
@@ -104,6 +107,9 @@
*/
CDRAPI bool libcdr::CDRDocument::parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
{
+ if (!input || !painter)
+ return false;
+
input->seek(0, librevenge::RVNG_SEEK_SET);
bool retVal = false;
unsigned version = 0;
@@ -225,7 +231,6 @@
}
if (input != tmpInput)
delete input;
- input = tmpInput;
for (std::vector::iterator iter = dataStreams.begin(); iter != dataStreams.end(); ++iter)
delete *iter;
return retVal;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/src/lib/CDRInternalStream.cpp new/libcdr-0.1.1/src/lib/CDRInternalStream.cpp
--- old/libcdr-0.1.0/src/lib/CDRInternalStream.cpp 2014-03-29 11:23:47.000000000 +0100
+++ new/libcdr-0.1.1/src/lib/CDRInternalStream.cpp 2014-11-20 16:30:05.000000000 +0100
@@ -61,7 +61,10 @@
const unsigned char *tmpBuffer = input->read(size, tmpNumBytesRead);
if (size != tmpNumBytesRead)
+ {
+ (void)inflateEnd(&strm);
return;
+ }
strm.avail_in = (uInt)tmpNumBytesRead;
strm.next_in = (Bytef *)tmpBuffer;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/src/lib/CDRParser.cpp new/libcdr-0.1.1/src/lib/CDRParser.cpp
--- old/libcdr-0.1.0/src/lib/CDRParser.cpp 2014-04-10 12:41:50.000000000 +0200
+++ new/libcdr-0.1.1/src/lib/CDRParser.cpp 2014-11-21 12:33:36.000000000 +0100
@@ -483,7 +483,7 @@
input->seek(startPosition + length, librevenge::RVNG_SEEK_SET);
}
-bool libcdr::CDRParser::parseRecords(librevenge::RVNGInputStream *input, unsigned *blockLengths, unsigned level)
+bool libcdr::CDRParser::parseRecords(librevenge::RVNGInputStream *input, const std::vector<unsigned> &blockLengths, unsigned level)
{
if (!input)
{
@@ -498,7 +498,7 @@
return true;
}
-bool libcdr::CDRParser::parseRecord(librevenge::RVNGInputStream *input, unsigned *blockLengths, unsigned level)
+bool libcdr::CDRParser::parseRecord(librevenge::RVNGInputStream *input, const std::vector<unsigned> &blockLengths, unsigned level)
{
if (!input)
{
@@ -516,7 +516,7 @@
return true;
unsigned fourCC = readU32(input);
unsigned length = readU32(input);
- if (blockLengths)
+ if (blockLengths.size() > length)
length=blockLengths[length];
unsigned long position = input->tell();
unsigned listType(0);
@@ -576,7 +576,7 @@
CDRInternalStream tmpBlocksStream(input, blocksLength, compressed);
while (!tmpBlocksStream.isEnd())
tmpBlockLengths.push_back(readU32(&tmpBlocksStream));
- if (!parseRecords(&tmpStream, tmpBlockLengths.size() ? &tmpBlockLengths[0] : 0, level+1))
+ if (!parseRecords(&tmpStream, tmpBlockLengths, level+1))
return false;
}
}
@@ -1637,6 +1637,8 @@
long startPosition = input->tell();
unsigned chunkLength = readUnsigned(input);
unsigned numOfArgs = readUnsigned(input);
+ if (numOfArgs > length / 4) // avoid extra big allocation in case of a broken file
+ numOfArgs = length / 4;
unsigned startOfArgs = readUnsigned(input);
std::vector<unsigned> argOffsets(numOfArgs, 0);
unsigned i = 0;
@@ -2044,6 +2046,8 @@
long startPosition = input->tell();
unsigned chunkLength = readUnsigned(input);
unsigned numOfArgs = readUnsigned(input);
+ if (numOfArgs > length / 4) // avoid extra big allocation in case of a broken file
+ numOfArgs = length / 4;
unsigned startOfArgs = readUnsigned(input);
unsigned startOfArgTypes = readUnsigned(input);
unsigned chunkType = readUnsigned(input);
@@ -2277,6 +2281,8 @@
palette.push_back(b | (g << 8) | (r << 16));
}
}
+ if (bmpsize == 0)
+ return;
std::vector<unsigned char> bitmap(bmpsize);
unsigned long tmpNumBytesRead = 0;
const unsigned char *tmpBuffer = input->read(bmpsize, tmpNumBytesRead);
@@ -2592,22 +2598,13 @@
}
unsigned numIntervals = readU32(input);
CDR_DEBUG_MSG(("CDRParser::readStlt numIntervals 0x%x\n", numIntervals));
- for (i=0; iseek(52, librevenge::RVNG_SEEK_CUR);
- }
+ input->seek(52 * static_cast<long>(numIntervals), librevenge::RVNG_SEEK_CUR);
unsigned numSet5s = readU32(input);
CDR_DEBUG_MSG(("CDRParser::readStlt numSet5s 0x%x\n", numSet5s));
- for (i=0; iseek(152, librevenge::RVNG_SEEK_CUR);
- }
+ input->seek(152 * static_cast<long>(numSet5s), librevenge::RVNG_SEEK_CUR);
unsigned numTabs = readU32(input);
CDR_DEBUG_MSG(("CDRParser::readStlt numTabs 0x%x\n", numTabs));
- for (i=0; iseek(784, librevenge::RVNG_SEEK_CUR);
- }
+ input->seek(784 * static_cast<long>(numTabs), librevenge::RVNG_SEEK_CUR);
unsigned numBullets = readU32(input);
CDR_DEBUG_MSG(("CDRParser::readStlt numBullets 0x%x\n", numBullets));
for (i=0; iseek(32, librevenge::RVNG_SEEK_CUR);
- if (m_version >= 1300)
- input->seek(4, librevenge::RVNG_SEEK_CUR);
- }
+ long hypensLen = 32;
+ if (m_version >= 1300)
+ hypensLen += 4;
+ input->seek(hypensLen * static_cast<long>(numHypens), librevenge::RVNG_SEEK_CUR);
unsigned numDropcaps = readU32(input);
CDR_DEBUG_MSG(("CDRParser::readStlt numDropcaps 0x%x\n", numDropcaps));
- for (i=0; iseek(28, librevenge::RVNG_SEEK_CUR);
- }
+ input->seek(28 * static_cast<long>(numDropcaps), librevenge::RVNG_SEEK_CUR);
try
{
bool set11Flag(false);
@@ -2665,10 +2657,7 @@
set11Flag = true;
unsigned numSet11s = readU32(input);
CDR_DEBUG_MSG(("CDRParser::readStlt numSet11s 0x%x\n", numSet11s));
- for (i=0; iseek(12, librevenge::RVNG_SEEK_CUR);
- }
+ input->seek(12 * static_cast<long>(numSet11s), librevenge::RVNG_SEEK_CUR);
}
std::map styles;
for (i=0; itell();
unsigned chunkLength = readUnsigned(input);
unsigned numOfArgs = readUnsigned(input);
+ if (numOfArgs > chunkLength / 4) // avoid extra big allocation in case of a broken file
+ numOfArgs = chunkLength / 4;
unsigned startOfArgs = readUnsigned(input);
unsigned startOfArgTypes = readUnsigned(input);
CDRCharacterStyle charStyle;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/src/lib/CDRParser.h new/libcdr-0.1.1/src/lib/CDRParser.h
--- old/libcdr-0.1.0/src/lib/CDRParser.h 2014-04-10 12:41:50.000000000 +0200
+++ new/libcdr-0.1.1/src/lib/CDRParser.h 2014-07-29 18:23:00.000000000 +0200
@@ -29,7 +29,7 @@
public:
explicit CDRParser(const std::vector &externalStreams, CDRCollector *collector);
virtual ~CDRParser();
- bool parseRecords(librevenge::RVNGInputStream *input, unsigned *blockLengths = 0, unsigned level = 0);
+ bool parseRecords(librevenge::RVNGInputStream *input, const std::vector<unsigned> &blockLengths = std::vector<unsigned>(), unsigned level = 0);
bool parseWaldo(librevenge::RVNGInputStream *input);
private:
@@ -44,7 +44,7 @@
std::map &records6, std::map &records7,
std::map &records8, std::map recordsOther);
void readWaldoRecord(librevenge::RVNGInputStream *input, const WaldoRecordInfo &info);
- bool parseRecord(librevenge::RVNGInputStream *input, unsigned *blockLengths = 0, unsigned level = 0);
+ bool parseRecord(librevenge::RVNGInputStream *input, const std::vector<unsigned> &blockLengths = std::vector<unsigned>(), unsigned level = 0);
void readRecord(unsigned fourCC, unsigned length, librevenge::RVNGInputStream *input);
double readRectCoord(librevenge::RVNGInputStream *input);
CDRColor readColor(librevenge::RVNGInputStream *input);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/src/lib/CDRStylesCollector.cpp new/libcdr-0.1.1/src/lib/CDRStylesCollector.cpp
--- old/libcdr-0.1.0/src/lib/CDRStylesCollector.cpp 2014-03-29 11:23:47.000000000 +0100
+++ new/libcdr-0.1.1/src/lib/CDRStylesCollector.cpp 2014-11-20 16:16:55.000000000 +0100
@@ -113,6 +113,8 @@
while (i < lineWidth && i < width)
{
unsigned char c = bitmap[j*lineWidth+i];
+ if (c >= palette.size())
+ c = palette.size() - 1;
i++;
writeU32(image, m_ps.getBMPColor(libcdr::CDRColor(colorModel, palette[c])));
}
@@ -244,7 +246,7 @@
}
tmpTextData.push_back(data[j++]);
- if (tmpCharDescription & 0x01)
+ if ((tmpCharDescription & 0x01) && (j < data.size()))
tmpTextData.push_back(data[j++]);
}
if (!tmpTextData.empty())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libcdr-0.1.0/src/lib/CMXDocument.cpp new/libcdr-0.1.1/src/lib/CMXDocument.cpp
--- old/libcdr-0.1.0/src/lib/CMXDocument.cpp 2014-03-29 11:23:47.000000000 +0100
+++ new/libcdr-0.1.1/src/lib/CMXDocument.cpp 2014-07-29 18:23:00.000000000 +0200
@@ -25,6 +25,9 @@
CDRAPI bool libcdr::CMXDocument::isSupported(librevenge::RVNGInputStream *input)
try
{
+ if (!input)
+ return false;
+
input->seek(0, librevenge::RVNG_SEEK_SET);
unsigned riff = readU32(input);
if (riff != CDR_FOURCC_RIFF && riff != CDR_FOURCC_RIFX)
@@ -56,6 +59,9 @@
*/
CDRAPI bool libcdr::CMXDocument::parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
{
+ if (!input || !painter)
+ return false;
+
input->seek(0, librevenge::RVNG_SEEK_SET);
CDRParserState ps;
CDRStylesCollector stylesCollector(ps);
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org