[libstaroffice] 01/04: New upstream version 0.0.4
Rene Engelhard
rene at moszumanska.debian.org
Thu Jul 20 17:34:46 UTC 2017
This is an automated email from the git hooks/post-receive script.
rene pushed a commit to branch master
in repository libstaroffice.
commit 40025e74b6b2b9f26583856676688416bc659081
Author: Rene Engelhard <rene at rene-engelhard.de>
Date: Thu Jul 20 19:31:21 2017 +0200
New upstream version 0.0.4
---
ChangeLog | 98 ++++++++++
NEWS | 6 +-
README | 27 ++-
aclocal.m4 | 16 +-
configure | 122 ++++++++----
configure.ac | 19 +-
inc/libstaroffice/STOFFDocument.hxx | 2 +-
src/Makefile.am | 3 +
src/Makefile.in | 5 +-
src/fuzz/Makefile.am | 34 ++++
src/{ => fuzz}/Makefile.in | 356 +++++++++++++++++++----------------
src/fuzz/sdafuzzer.cpp | 47 +++++
src/fuzz/sdcfuzzer.cpp | 47 +++++
src/fuzz/sddfuzzer.cpp | 47 +++++
src/fuzz/sdwfuzzer.cpp | 47 +++++
src/lib/._StarBitmap.cxx | Bin 171 -> 0 bytes
src/lib/STOFFCell.cxx | 7 +-
src/lib/STOFFChart.cxx | 1 +
src/lib/STOFFDebug.hxx | 2 +-
src/lib/STOFFSpreadsheetListener.cxx | 4 +-
src/lib/STOFFTextListener.cxx | 6 +-
src/lib/StarAttribute.hxx | 2 +-
src/lib/StarBitmap.cxx | 24 ++-
src/lib/StarEncoding.cxx | 2 +-
src/lib/StarEncodingChinese.cxx | 2 +-
src/lib/StarFormatManager.cxx | 6 +-
src/lib/StarWriterStruct.cxx | 2 +-
src/lib/libstaroffice_internal.hxx | 14 ++
28 files changed, 691 insertions(+), 257 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index bb3c7eb..e652404 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,101 @@
+2017-07-16 osnola <alonso at loria.fr> [5a00b2c8eb39a7a99a7581b5d4dad7853da553d1]
+
+tUpdate READMEs files + update the configure.ac's minor version...
+
+
+2017-07-03 osnola <alonso at loria.fr> [e49d2adca27326da7c130652ab35c4a9f1cd083d]
+
+tRename FALLTHROUGH in STOFF_FALLTHROUGH + try to simplify the code...
+
+
+2017-07-02 osnola <alonso at loria.fr> [48b418c81f152dae484e9a297ad81697b0f2a4e0]
+
+tgcc7: try to remove some warnings...
+
+
+2017-05-17 David Tardon <dtardon at redhat.com> [0bf920d26d02ae0f006d6cc0eff0cd5d706e29e3]
+
+tofz#1252 check for end of record
+
+
+2017-05-17 David Tardon <dtardon at redhat.com> [fa2bfff83e9ef6d8c6b3d3629079eabf4e91dd5e]
+
+tlikely intent
+
+
+2017-05-14 osnola <alonso at loria.fr> [7c9f9142a142af961e0eca67c6ab55abae7c7e3f]
+
+tmingw: correct a problem...
+
+
+2017-04-20 David Tardon <dtardon at redhat.com> [cc349517ccd57fcf05309992098ec7ce70bb299f]
+
+tofz#1145 avoid negative shift value
+
+
+2017-04-20 David Tardon <dtardon at redhat.com> [1feb3b8eb55d7659c278705745ae66b260a64cd8]
+
+tofz#1059 replace * by / to avoid truncation
+
+
+2017-04-20 David Tardon <dtardon at redhat.com> [1fde47747be83ae2d453b0c85a3cdfc8943cfa55]
+
+tWaE: comparison between signed and unsigned integer expressions
+
+
+2017-04-15 David Tardon <dtardon at redhat.com> [6fde2968cc9aeb2455ae487614834c202bac33bf]
+
+tofz#1111 add missing entry to encoding table
+
+
+2017-04-12 David Tardon <dtardon at redhat.com> [071ea36f8a14d5b67ffbe61b49da4053b553b6fe]
+
+tofz#1075 fix shifts for 16-bit color in RGB555 fmt
+
+
+2017-04-08 David Tardon <dtardon at redhat.com> [95b119ede6060b81ebcfbc31bb57f215520445b8]
+
+tofz#1056 check max possible # of colors in palette
+
+t... to avoid integer overflow
+
+2017-04-07 David Tardon <dtardon at redhat.com> [2d6253c7a692a3d92785dd990fce7256ea05e794]
+
+tofz#1029 use correct loop index
+
+tTo be honest, I think this would be clearer as two separate reads to two
+tseparate vars...
+
+2017-04-05 David Tardon <dtardon at redhat.com> [7b04b9880ee8ffabcb515362ed5027070c4e4ca2]
+
+tavoid memory leak on error
+
+
+2017-04-05 David Tardon <dtardon at redhat.com> [87b350f0a7b65b0f98f5008273340b16d8cb2ed9]
+
+tadd sdw fuzzer
+
+
+2017-04-05 David Tardon <dtardon at redhat.com> [f2847fd4c9c3714a031b4ef91aa77e6f91530261]
+
+tadd sdd fuzzer
+
+
+2017-04-05 David Tardon <dtardon at redhat.com> [25123f89a91931842c142e9d23e69bd9fa8854d4]
+
+tadd sda fuzzer
+
+
+2017-04-01 David Tardon <dtardon at redhat.com> [c4ff074b7b7b332b3b5feecf51798c205251d9cd]
+
+tadd fuzzing driver for oss-fuzz
+
+
+2017-04-01 David Tardon <dtardon at redhat.com> [d5106a66473f77cd6e5b3447ea5b6e4e7cfdec91]
+
+tastyle
+
+
2017-02-21 osnola <alonso at loria.fr> [bf3c107245683836f1ba6bba6da86e960e673eec]
tUpdate some README files...
diff --git a/NEWS b/NEWS
index 989cbd5..2fae24b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
+0.0.4:
+- 07/15/2017:
+ - correct many errors detected by fuzzing
+
0.0.3:
-- 20/02/2017:
+- 02/20/2017:
- tests if the file is created by StarImpress, if yes, converts it
in a presentation file,
- .sdw: try to retrieve more table's formattings and some outline levels,
diff --git a/README b/README
index 6f1c4f3..74a5e1a 100644
--- a/README
+++ b/README
@@ -4,20 +4,19 @@ https://sourceforge.net/p/libwpd/wiki/librevenge/ and
http://www.documentliberation.org/projects/ ).
Currently:
-- .sda files: it tries to retrieve some basic contents, ie. the basic shapes
- (lines, rectangles, ellipse, ...), the bitmaps and some formattings. But
- this parser is still incomplete: some default formattings are simply ignored
- ...
-- .sdc files: it tries to convert the main content of a .sdc files, ie. the
- cells' value/text/formula, the cells' comments and the cells'
- formattings. But it does not try to retrieve formatting in the bock
- of texts or any embedded charts, ...
-- .sdg files: it tries to retrieve all the bitmap .bm in the files. Other
- objects are simply ignored and some bitmaps are reconstructed with bad
- vertical orientations, ...
-- .sdw files: begins to retrieve the main text contents with formattings. But
- this parser is still incomplete, ie. many embedding pictures/tables are not
- retrieved and when table are retrieved, their formatting is lost...
+- .sda/.sdp files: it tries to retrieve some basic contents, ie. the
+ basic shapes (lines, rectangles, ellipse, ...), the bitmaps and some
+ formattings. But this parser is still incomplete: some default
+ formattings are simply ignored ...
+- .sdc files: it tries to convert the main content of a .sdc files,
+ ie. the cells' value/text/formula, the cells' comments and the
+ cells' formattings. But it does not try to retrieve any embedded
+ charts, ...
+- .sdg files: it tries to retrieve all the bitmap .bm in the
+ files. Other objects are simply ignored and some bitmaps are
+ reconstructed with bad vertical orientations, ...
+- .sdw files: begins to retrieve the main text contents with
+ formattings. But this parser is still incomplete...
- other .sd? files: it refuses to convert them, ...
Notes:
diff --git a/aclocal.m4 b/aclocal.m4
index 483e43b..93b7f07 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -20,9 +20,9 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-dnl serial 11 (pkg-config-0.29.1)
-dnl
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
+
dnl Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists at gmail.com>
dnl
@@ -63,7 +63,7 @@ dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
-[m4_define([PKG_MACROS_VERSION], [0.29.1])
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
@@ -164,7 +164,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
-AC_MSG_CHECKING([for $1])
+AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@@ -174,11 +174,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
- else
+ else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
@@ -195,7 +195,7 @@ installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
diff --git a/configure b/configure
index c9f4391..72c3ca7 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libstaroffice 0.0.3.
+# Generated by GNU Autoconf 2.69 for libstaroffice 0.0.4.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libstaroffice'
PACKAGE_TARNAME='libstaroffice'
-PACKAGE_VERSION='0.0.3'
-PACKAGE_STRING='libstaroffice 0.0.3'
+PACKAGE_VERSION='0.0.4'
+PACKAGE_STRING='libstaroffice 0.0.4'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -632,12 +632,14 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
-BUILD_TOOLS_FALSE
-BUILD_TOOLS_TRUE
REVENGE_STREAM_LIBS
REVENGE_STREAM_CFLAGS
REVENGE_GENERATORS_LIBS
REVENGE_GENERATORS_CFLAGS
+BUILD_FUZZERS_FALSE
+BUILD_FUZZERS_TRUE
+BUILD_TOOLS_FALSE
+BUILD_TOOLS_TRUE
REVENGE_LIBS
REVENGE_CFLAGS
WITH_LIBSTAROFFICE_DOCS_FALSE
@@ -816,6 +818,7 @@ enable_static_tools
with_sharedptr
with_docs
enable_tools
+enable_fuzzers
'
ac_precious_vars='build_alias
host_alias
@@ -1382,7 +1385,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libstaroffice 0.0.3 to adapt to many kinds of systems.
+\`configure' configures libstaroffice 0.0.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1452,7 +1455,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libstaroffice 0.0.3:";;
+ short | recursive ) echo "Configuration of libstaroffice 0.0.4:";;
esac
cat <<\_ACEOF
@@ -1481,6 +1484,7 @@ Optional Features:
--enable-full-debug Turn on debugging and debug files' creation
--enable-static-tools Link tools (binaries) statically
--disable-tools Build conversion tools
+ --enable-fuzzers Build fuzzer(s)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1598,7 +1602,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libstaroffice configure 0.0.3
+libstaroffice configure 0.0.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2084,7 +2088,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libstaroffice $as_me 0.0.3, which was
+It was created by libstaroffice $as_me 0.0.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2950,7 +2954,7 @@ fi
# Define the identity of the package.
PACKAGE='libstaroffice'
- VERSION='0.0.3'
+ VERSION='0.0.4'
cat >>confdefs.h <<_ACEOF
@@ -17249,16 +17253,16 @@ STAROFFICE_MAJOR_VERSION=0
STAROFFICE_MINOR_VERSION=0
-STAROFFICE_MICRO_VERSION=3
+STAROFFICE_MICRO_VERSION=4
-STAROFFICE_VERSION=0.0.3
+STAROFFICE_VERSION=0.0.4
# AC_SUBST(LT_RELEASE, [libstaroffice_version_major.libstaroffice_version_minor])
LT_CURRENT=`expr 100 '*' 0 + 0`
# For 1.0.0 comment the first line and uncomment the second
LT_AGE=0
-LT_REVISION=3
+LT_REVISION=4
@@ -17630,8 +17634,8 @@ if test "x$with_zip" != "xno"; then
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZLIB" >&5
-$as_echo_n "checking for ZLIB... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib" >&5
+$as_echo_n "checking for zlib... " >&6; }
if test -n "$ZLIB_CFLAGS"; then
pkg_cv_ZLIB_CFLAGS="$ZLIB_CFLAGS"
@@ -17671,7 +17675,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -17740,7 +17744,7 @@ fi
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
ac_fn_cxx_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
@@ -18149,8 +18153,8 @@ fi
# ====================
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for REVENGE" >&5
-$as_echo_n "checking for REVENGE... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for librevenge-0.0 " >&5
+$as_echo_n "checking for librevenge-0.0 ... " >&6; }
if test -n "$REVENGE_CFLAGS"; then
pkg_cv_REVENGE_CFLAGS="$REVENGE_CFLAGS"
@@ -18190,7 +18194,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -18217,7 +18221,7 @@ Alternatively, you may set the environment variables REVENGE_CFLAGS
and REVENGE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -18252,12 +18256,45 @@ else
fi
-if test "x$enable_tools" = "xyes"; then :
+ if test "x$enable_tools" = "xyes"; then
+ BUILD_TOOLS_TRUE=
+ BUILD_TOOLS_FALSE='#'
+else
+ BUILD_TOOLS_TRUE='#'
+ BUILD_TOOLS_FALSE=
+fi
+
+
+# =======
+# Fuzzers
+# =======
+# Check whether --enable-fuzzers was given.
+if test "${enable_fuzzers+set}" = set; then :
+ enableval=$enable_fuzzers; enable_fuzzers="$enableval"
+else
+ enable_fuzzers=no
+
+fi
+
+ if test "x$enable_fuzzers" = "xyes"; then
+ BUILD_FUZZERS_TRUE=
+ BUILD_FUZZERS_FALSE='#'
+else
+ BUILD_FUZZERS_TRUE='#'
+ BUILD_FUZZERS_FALSE=
+fi
+
+
+if test "x$enable_tools" = "xyes" -o "x$enable_fuzzers" = "xyes"; then :
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for REVENGE_GENERATORS" >&5
-$as_echo_n "checking for REVENGE_GENERATORS... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for
+ librevenge-generators-0.0
+ " >&5
+$as_echo_n "checking for
+ librevenge-generators-0.0
+ ... " >&6; }
if test -n "$REVENGE_GENERATORS_CFLAGS"; then
pkg_cv_REVENGE_GENERATORS_CFLAGS="$REVENGE_GENERATORS_CFLAGS"
@@ -18309,7 +18346,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -18342,7 +18379,7 @@ Alternatively, you may set the environment variables REVENGE_GENERATORS_CFLAGS
and REVENGE_GENERATORS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -18365,8 +18402,12 @@ $as_echo "yes" >&6; }
fi
pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for REVENGE_STREAM" >&5
-$as_echo_n "checking for REVENGE_STREAM... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for
+ librevenge-stream-0.0
+ " >&5
+$as_echo_n "checking for
+ librevenge-stream-0.0
+ ... " >&6; }
if test -n "$REVENGE_STREAM_CFLAGS"; then
pkg_cv_REVENGE_STREAM_CFLAGS="$REVENGE_STREAM_CFLAGS"
@@ -18418,7 +18459,7 @@ fi
if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -18451,7 +18492,7 @@ Alternatively, you may set the environment variables REVENGE_STREAM_CFLAGS
and REVENGE_STREAM_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -18478,19 +18519,11 @@ fi
- if test "x$enable_tools" = "xyes"; then
- BUILD_TOOLS_TRUE=
- BUILD_TOOLS_FALSE='#'
-else
- BUILD_TOOLS_TRUE='#'
- BUILD_TOOLS_FALSE=
-fi
-
# =====================
# Prepare all .in files
# =====================
-ac_config_files="$ac_config_files Makefile inc/Makefile inc/libstaroffice/Makefile src/Makefile src/conv/Makefile src/conv/sdc2csv/Makefile src/conv/sdc2csv/sdc2csv.rc src/conv/sdw2html/Makefile src/conv/sdw2html/sdw2html.rc src/conv/sd2raw/Makefile src/conv/sd2raw/sd2raw.rc src/conv/sd2svg/Makefile src/conv/sd2svg/sd2svg.rc src/conv/sd2text/Makefile src/conv/sd2text/sd2text.rc src/lib/Makefile src/lib/libstaroffice.rc docs/Makefile docs/doxygen/Makefile build/Makefile build/win32/Makefi [...]
+ac_config_files="$ac_config_files Makefile inc/Makefile inc/libstaroffice/Makefile src/Makefile src/conv/Makefile src/conv/sdc2csv/Makefile src/conv/sdc2csv/sdc2csv.rc src/conv/sdw2html/Makefile src/conv/sdw2html/sdw2html.rc src/conv/sd2raw/Makefile src/conv/sd2raw/sd2raw.rc src/conv/sd2svg/Makefile src/conv/sd2svg/sd2svg.rc src/conv/sd2text/Makefile src/conv/sd2text/sd2text.rc src/fuzz/Makefile src/lib/Makefile src/lib/libstaroffice.rc docs/Makefile docs/doxygen/Makefile build/Makefile [...]
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -18657,6 +18690,10 @@ if test -z "${BUILD_TOOLS_TRUE}" && test -z "${BUILD_TOOLS_FALSE}"; then
as_fn_error $? "conditional \"BUILD_TOOLS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${BUILD_FUZZERS_TRUE}" && test -z "${BUILD_FUZZERS_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_FUZZERS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
@@ -19054,7 +19091,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libstaroffice $as_me 0.0.3, which was
+This file was extended by libstaroffice $as_me 0.0.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19120,7 +19157,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libstaroffice config.status 0.0.3
+libstaroffice config.status 0.0.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -19650,6 +19687,7 @@ do
"src/conv/sd2svg/sd2svg.rc") CONFIG_FILES="$CONFIG_FILES src/conv/sd2svg/sd2svg.rc" ;;
"src/conv/sd2text/Makefile") CONFIG_FILES="$CONFIG_FILES src/conv/sd2text/Makefile" ;;
"src/conv/sd2text/sd2text.rc") CONFIG_FILES="$CONFIG_FILES src/conv/sd2text/sd2text.rc" ;;
+ "src/fuzz/Makefile") CONFIG_FILES="$CONFIG_FILES src/fuzz/Makefile" ;;
"src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;;
"src/lib/libstaroffice.rc") CONFIG_FILES="$CONFIG_FILES src/lib/libstaroffice.rc" ;;
"docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
@@ -21107,6 +21145,7 @@ Build configuration:
debug: ${enable_debug}
full-debug: ${enable_full_debug}
docs: ${build_docs}
+ fuzzers: ${enable_fuzzers}
shared_ptr: ${with_sharedptr}
zip: ${with_zip}
static-tools: ${enable_static_tools}
@@ -21119,6 +21158,7 @@ Build configuration:
debug: ${enable_debug}
full-debug: ${enable_full_debug}
docs: ${build_docs}
+ fuzzers: ${enable_fuzzers}
shared_ptr: ${with_sharedptr}
zip: ${with_zip}
static-tools: ${enable_static_tools}
diff --git a/configure.ac b/configure.ac
index c29f374..a6be53c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ AC_PREREQ([2.65])
# ====================
m4_define([libstaroffice_version_major],[0])
m4_define([libstaroffice_version_minor],[0])
-m4_define([libstaroffice_version_micro],[3])
+m4_define([libstaroffice_version_micro],[4])
m4_define([libstaroffice_version],[libstaroffice_version_major.libstaroffice_version_minor.libstaroffice_version_micro])
# =============
@@ -384,7 +384,19 @@ AC_ARG_ENABLE([tools],
[enable_tools="$enableval"],
[enable_tools=yes]
)
-AS_IF([test "x$enable_tools" = "xyes"], [
+AM_CONDITIONAL(BUILD_TOOLS, [test "x$enable_tools" = "xyes"])
+
+# =======
+# Fuzzers
+# =======
+AC_ARG_ENABLE([fuzzers],
+ [AS_HELP_STRING([--enable-fuzzers], [Build fuzzer(s)])],
+ [enable_fuzzers="$enableval"],
+ [enable_fuzzers=no]
+)
+AM_CONDITIONAL(BUILD_FUZZERS, [test "x$enable_fuzzers" = "xyes"])
+
+AS_IF([test "x$enable_tools" = "xyes" -o "x$enable_fuzzers" = "xyes"], [
PKG_CHECK_MODULES([REVENGE_GENERATORS],[
librevenge-generators-0.0
])
@@ -396,7 +408,6 @@ AC_SUBST([REVENGE_GENERATORS_CFLAGS])
AC_SUBST([REVENGE_GENERATORS_LIBS])
AC_SUBST([REVENGE_STREAM_CFLAGS])
AC_SUBST([REVENGE_STREAM_LIBS])
-AM_CONDITIONAL(BUILD_TOOLS, [test "x$enable_tools" = "xyes"])
# =====================
# Prepare all .in files
@@ -417,6 +428,7 @@ src/conv/sd2svg/Makefile
src/conv/sd2svg/sd2svg.rc
src/conv/sd2text/Makefile
src/conv/sd2text/sd2text.rc
+src/fuzz/Makefile
src/lib/Makefile
src/lib/libstaroffice.rc
docs/Makefile
@@ -437,6 +449,7 @@ Build configuration:
debug: ${enable_debug}
full-debug: ${enable_full_debug}
docs: ${build_docs}
+ fuzzers: ${enable_fuzzers}
shared_ptr: ${with_sharedptr}
zip: ${with_zip}
static-tools: ${enable_static_tools}
diff --git a/inc/libstaroffice/STOFFDocument.hxx b/inc/libstaroffice/STOFFDocument.hxx
index 2efeb4d..0de6d1a 100644
--- a/inc/libstaroffice/STOFFDocument.hxx
+++ b/inc/libstaroffice/STOFFDocument.hxx
@@ -25,7 +25,7 @@
#ifndef STOFFDOCUMENT_HXX
#define STOFFDOCUMENT_HXX
-#ifdef DLL_EXPORT
+#ifdef _WINDLL
#ifdef BUILD_STOFF
#define STOFFLIB __declspec(dllexport)
#else
diff --git a/src/Makefile.am b/src/Makefile.am
index db92e39..c83c78c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,3 +4,6 @@ if BUILD_TOOLS
SUBDIRS += conv
endif
+if BUILD_FUZZERS
+SUBDIRS += fuzz
+endif
diff --git a/src/Makefile.in b/src/Makefile.in
index 5e75cf5..11d0f01 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -88,6 +88,7 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@BUILD_TOOLS_TRUE at am__append_1 = conv
+ at BUILD_FUZZERS_TRUE@am__append_2 = fuzz
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
@@ -155,7 +156,7 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
-DIST_SUBDIRS = lib conv
+DIST_SUBDIRS = lib conv fuzz
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
@@ -332,7 +333,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = lib $(am__append_1)
+SUBDIRS = lib $(am__append_1) $(am__append_2)
all: all-recursive
.SUFFIXES:
diff --git a/src/fuzz/Makefile.am b/src/fuzz/Makefile.am
new file mode 100644
index 0000000..3b9a6de
--- /dev/null
+++ b/src/fuzz/Makefile.am
@@ -0,0 +1,34 @@
+noinst_PROGRAMS = sdafuzzer sdcfuzzer sddfuzzer sdwfuzzer
+
+AM_CXXFLAGS = -I$(top_srcdir)/inc \
+ $(REVENGE_GENERATORS_CFLAGS) \
+ $(REVENGE_CFLAGS) \
+ $(REVENGE_STREAM_CFLAGS) \
+ $(DEBUG_CXXFLAGS)
+
+commonfuzzer_ldadd = \
+ $(top_builddir)/src/lib/libstaroffice- at STAROFFICE_MAJOR_VERSION@. at STAROFFICE_MINOR_VERSION@.la \
+ $(REVENGE_GENERATORS_LIBS) \
+ $(REVENGE_LIBS) \
+ $(REVENGE_STREAM_LIBS) \
+ -lFuzzingEngine
+
+sdafuzzer_LDADD = $(commonfuzzer_ldadd)
+
+sdafuzzer_SOURCES = \
+ sdafuzzer.cpp
+
+sdcfuzzer_LDADD = $(commonfuzzer_ldadd)
+
+sdcfuzzer_SOURCES = \
+ sdcfuzzer.cpp
+
+sddfuzzer_LDADD = $(commonfuzzer_ldadd)
+
+sddfuzzer_SOURCES = \
+ sddfuzzer.cpp
+
+sdwfuzzer_LDADD = $(commonfuzzer_ldadd)
+
+sdwfuzzer_SOURCES = \
+ sdwfuzzer.cpp
diff --git a/src/Makefile.in b/src/fuzz/Makefile.in
similarity index 64%
copy from src/Makefile.in
copy to src/fuzz/Makefile.in
index 5e75cf5..0a8933e 100644
--- a/src/Makefile.in
+++ b/src/fuzz/Makefile.in
@@ -13,6 +13,7 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
@@ -87,8 +88,9 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
- at BUILD_TOOLS_TRUE@am__append_1 = conv
-subdir = src
+noinst_PROGRAMS = sdafuzzer$(EXEEXT) sdcfuzzer$(EXEEXT) \
+ sddfuzzer$(EXEEXT) sdwfuzzer$(EXEEXT)
+subdir = src/fuzz
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -101,6 +103,27 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_sdafuzzer_OBJECTS = sdafuzzer.$(OBJEXT)
+sdafuzzer_OBJECTS = $(am_sdafuzzer_OBJECTS)
+am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = $(top_builddir)/src/lib/libstaroffice- at STAROFFICE_MAJOR_VERSION@. at STAROFFICE_MINOR_VERSION@.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+sdafuzzer_DEPENDENCIES = $(am__DEPENDENCIES_2)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+am_sdcfuzzer_OBJECTS = sdcfuzzer.$(OBJEXT)
+sdcfuzzer_OBJECTS = $(am_sdcfuzzer_OBJECTS)
+sdcfuzzer_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_sddfuzzer_OBJECTS = sddfuzzer.$(OBJEXT)
+sddfuzzer_OBJECTS = $(am_sddfuzzer_OBJECTS)
+sddfuzzer_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_sdwfuzzer_OBJECTS = sdwfuzzer.$(OBJEXT)
+sdwfuzzer_OBJECTS = $(am_sdwfuzzer_OBJECTS)
+sdwfuzzer_DEPENDENCIES = $(am__DEPENDENCIES_2)
AM_V_P = $(am__v_P_ at AM_V@)
am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
am__v_P_0 = false
@@ -113,29 +136,37 @@ AM_V_at = $(am__v_at_ at AM_V@)
am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
- ctags-recursive dvi-recursive html-recursive info-recursive \
- install-data-recursive install-dvi-recursive \
- install-exec-recursive install-html-recursive \
- install-info-recursive install-pdf-recursive \
- install-ps-recursive install-recursive installcheck-recursive \
- installdirs-recursive pdf-recursive ps-recursive \
- tags-recursive uninstall-recursive
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_ at AM_V@)
+am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
+SOURCES = $(sdafuzzer_SOURCES) $(sdcfuzzer_SOURCES) \
+ $(sddfuzzer_SOURCES) $(sdwfuzzer_SOURCES)
+DIST_SOURCES = $(sdafuzzer_SOURCES) $(sdcfuzzer_SOURCES) \
+ $(sddfuzzer_SOURCES) $(sdwfuzzer_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
- $(RECURSIVE_TARGETS) \
- $(RECURSIVE_CLEAN_TARGETS) \
- $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- distdir
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -155,34 +186,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
-DIST_SUBDIRS = lib conv
-am__DIST_COMMON = $(srcdir)/Makefile.in
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -332,10 +337,39 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = lib $(am__append_1)
-all: all-recursive
+AM_CXXFLAGS = -I$(top_srcdir)/inc \
+ $(REVENGE_GENERATORS_CFLAGS) \
+ $(REVENGE_CFLAGS) \
+ $(REVENGE_STREAM_CFLAGS) \
+ $(DEBUG_CXXFLAGS)
+
+commonfuzzer_ldadd = \
+ $(top_builddir)/src/lib/libstaroffice- at STAROFFICE_MAJOR_VERSION@. at STAROFFICE_MINOR_VERSION@.la \
+ $(REVENGE_GENERATORS_LIBS) \
+ $(REVENGE_LIBS) \
+ $(REVENGE_STREAM_LIBS) \
+ -lFuzzingEngine
+
+sdafuzzer_LDADD = $(commonfuzzer_ldadd)
+sdafuzzer_SOURCES = \
+ sdafuzzer.cpp
+
+sdcfuzzer_LDADD = $(commonfuzzer_ldadd)
+sdcfuzzer_SOURCES = \
+ sdcfuzzer.cpp
+
+sddfuzzer_LDADD = $(commonfuzzer_ldadd)
+sddfuzzer_SOURCES = \
+ sddfuzzer.cpp
+
+sdwfuzzer_LDADD = $(commonfuzzer_ldadd)
+sdwfuzzer_SOURCES = \
+ sdwfuzzer.cpp
+
+all: all-am
.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -345,9 +379,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/fuzz/Makefile'; \
$(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/Makefile
+ $(AUTOMAKE) --foreign src/fuzz/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -366,67 +400,77 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+sdafuzzer$(EXEEXT): $(sdafuzzer_OBJECTS) $(sdafuzzer_DEPENDENCIES) $(EXTRA_sdafuzzer_DEPENDENCIES)
+ @rm -f sdafuzzer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(sdafuzzer_OBJECTS) $(sdafuzzer_LDADD) $(LIBS)
+
+sdcfuzzer$(EXEEXT): $(sdcfuzzer_OBJECTS) $(sdcfuzzer_DEPENDENCIES) $(EXTRA_sdcfuzzer_DEPENDENCIES)
+ @rm -f sdcfuzzer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(sdcfuzzer_OBJECTS) $(sdcfuzzer_LDADD) $(LIBS)
+
+sddfuzzer$(EXEEXT): $(sddfuzzer_OBJECTS) $(sddfuzzer_DEPENDENCIES) $(EXTRA_sddfuzzer_DEPENDENCIES)
+ @rm -f sddfuzzer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(sddfuzzer_OBJECTS) $(sddfuzzer_LDADD) $(LIBS)
+
+sdwfuzzer$(EXEEXT): $(sdwfuzzer_OBJECTS) $(sdwfuzzer_DEPENDENCIES) $(EXTRA_sdwfuzzer_DEPENDENCIES)
+ @rm -f sdwfuzzer$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(sdwfuzzer_OBJECTS) $(sdwfuzzer_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sdafuzzer.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sdcfuzzer.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sddfuzzer.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sdwfuzzer.Po at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
- @fail=; \
- if $(am__make_keepgoing); then \
- failcom='fail=yes'; \
- else \
- failcom='exit 1'; \
- fi; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
+tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
@@ -439,7 +483,7 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$$unique; \
fi; \
fi
-ctags: ctags-recursive
+ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
@@ -452,7 +496,7 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
+cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
@@ -501,45 +545,19 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-installcheck: installcheck-recursive
+installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
@@ -561,86 +579,92 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
+clean: clean-am
-clean-am: clean-generic clean-libtool mostlyclean-am
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
-distclean: distclean-recursive
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
-dvi: dvi-recursive
+dvi: dvi-am
dvi-am:
-html: html-recursive
+html: html-am
html-am:
-info: info-recursive
+info: info-am
info-am:
install-data-am:
-install-dvi: install-dvi-recursive
+install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
-install-html: install-html-recursive
+install-html: install-html-am
install-html-am:
-install-info: install-info-recursive
+install-info: install-info-am
install-info-am:
install-man:
-install-pdf: install-pdf-recursive
+install-pdf: install-pdf-am
install-pdf-am:
-install-ps: install-ps-recursive
+install-ps: install-ps-am
install-ps-am:
installcheck-am:
-maintainer-clean: maintainer-clean-recursive
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
-mostlyclean: mostlyclean-recursive
+mostlyclean: mostlyclean-am
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
-pdf: pdf-recursive
+pdf: pdf-am
pdf-am:
-ps: ps-recursive
+ps: ps-am
ps-am:
uninstall-am:
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
- check-am clean clean-generic clean-libtool cscopelist-am ctags \
- ctags-am distclean distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags tags-am uninstall uninstall-am
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
+ ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
diff --git a/src/fuzz/sdafuzzer.cpp b/src/fuzz/sdafuzzer.cpp
new file mode 100644
index 0000000..7cfefd2
--- /dev/null
+++ b/src/fuzz/sdafuzzer.cpp
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
+
+/* libstaroffice
+* Version: MPL 2.0 / LGPLv2+
+*
+* The contents of this file are subject to the Mozilla Public License Version
+* 2.0 (the "License"); you may not use this file except in compliance with
+* the License or as specified alternatively below. You may obtain a copy of
+* the License at http://www.mozilla.org/MPL/
+*
+* Software distributed under the License is distributed on an "AS IS" basis,
+* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+* for the specific language governing rights and limitations under the
+* License.
+*
+* Major Contributor(s):
+* Copyright (C) 2017 David Tardon (dtardon at redhat.com)
+*
+*
+* All Rights Reserved.
+*
+* For minor contributions see the git repository.
+*
+* Alternatively, the contents of this file may be used under the terms of
+* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
+* in which case the provisions of the LGPLv2+ are applicable
+* instead of those above.
+*/
+
+#include <cstdint>
+#include <cstdlib>
+
+#include <librevenge-generators/librevenge-generators.h>
+
+#include <librevenge-stream/librevenge-stream.h>
+
+#include <libstaroffice/libstaroffice.hxx>
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ librevenge::RVNGStringStream input(data, size);
+ librevenge::RVNGRawDrawingGenerator generator(true);
+ STOFFDocument::parse(&input, &generator);
+ return 0;
+}
+
+// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
diff --git a/src/fuzz/sdcfuzzer.cpp b/src/fuzz/sdcfuzzer.cpp
new file mode 100644
index 0000000..e99bf3c
--- /dev/null
+++ b/src/fuzz/sdcfuzzer.cpp
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
+
+/* libstaroffice
+* Version: MPL 2.0 / LGPLv2+
+*
+* The contents of this file are subject to the Mozilla Public License Version
+* 2.0 (the "License"); you may not use this file except in compliance with
+* the License or as specified alternatively below. You may obtain a copy of
+* the License at http://www.mozilla.org/MPL/
+*
+* Software distributed under the License is distributed on an "AS IS" basis,
+* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+* for the specific language governing rights and limitations under the
+* License.
+*
+* Major Contributor(s):
+* Copyright (C) 2017 David Tardon (dtardon at redhat.com)
+*
+*
+* All Rights Reserved.
+*
+* For minor contributions see the git repository.
+*
+* Alternatively, the contents of this file may be used under the terms of
+* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
+* in which case the provisions of the LGPLv2+ are applicable
+* instead of those above.
+*/
+
+#include <cstdint>
+#include <cstdlib>
+
+#include <librevenge-generators/librevenge-generators.h>
+
+#include <librevenge-stream/librevenge-stream.h>
+
+#include <libstaroffice/libstaroffice.hxx>
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ librevenge::RVNGStringStream input(data, size);
+ librevenge::RVNGRawSpreadsheetGenerator generator(true);
+ STOFFDocument::parse(&input, &generator);
+ return 0;
+}
+
+// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
diff --git a/src/fuzz/sddfuzzer.cpp b/src/fuzz/sddfuzzer.cpp
new file mode 100644
index 0000000..3af76b0
--- /dev/null
+++ b/src/fuzz/sddfuzzer.cpp
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
+
+/* libstaroffice
+* Version: MPL 2.0 / LGPLv2+
+*
+* The contents of this file are subject to the Mozilla Public License Version
+* 2.0 (the "License"); you may not use this file except in compliance with
+* the License or as specified alternatively below. You may obtain a copy of
+* the License at http://www.mozilla.org/MPL/
+*
+* Software distributed under the License is distributed on an "AS IS" basis,
+* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+* for the specific language governing rights and limitations under the
+* License.
+*
+* Major Contributor(s):
+* Copyright (C) 2017 David Tardon (dtardon at redhat.com)
+*
+*
+* All Rights Reserved.
+*
+* For minor contributions see the git repository.
+*
+* Alternatively, the contents of this file may be used under the terms of
+* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
+* in which case the provisions of the LGPLv2+ are applicable
+* instead of those above.
+*/
+
+#include <cstdint>
+#include <cstdlib>
+
+#include <librevenge-generators/librevenge-generators.h>
+
+#include <librevenge-stream/librevenge-stream.h>
+
+#include <libstaroffice/libstaroffice.hxx>
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ librevenge::RVNGStringStream input(data, size);
+ librevenge::RVNGRawPresentationGenerator generator(true);
+ STOFFDocument::parse(&input, &generator);
+ return 0;
+}
+
+// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
diff --git a/src/fuzz/sdwfuzzer.cpp b/src/fuzz/sdwfuzzer.cpp
new file mode 100644
index 0000000..2fe4383
--- /dev/null
+++ b/src/fuzz/sdwfuzzer.cpp
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
+
+/* libstaroffice
+* Version: MPL 2.0 / LGPLv2+
+*
+* The contents of this file are subject to the Mozilla Public License Version
+* 2.0 (the "License"); you may not use this file except in compliance with
+* the License or as specified alternatively below. You may obtain a copy of
+* the License at http://www.mozilla.org/MPL/
+*
+* Software distributed under the License is distributed on an "AS IS" basis,
+* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+* for the specific language governing rights and limitations under the
+* License.
+*
+* Major Contributor(s):
+* Copyright (C) 2017 David Tardon (dtardon at redhat.com)
+*
+*
+* All Rights Reserved.
+*
+* For minor contributions see the git repository.
+*
+* Alternatively, the contents of this file may be used under the terms of
+* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
+* in which case the provisions of the LGPLv2+ are applicable
+* instead of those above.
+*/
+
+#include <cstdint>
+#include <cstdlib>
+
+#include <librevenge-generators/librevenge-generators.h>
+
+#include <librevenge-stream/librevenge-stream.h>
+
+#include <libstaroffice/libstaroffice.hxx>
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+ librevenge::RVNGStringStream input(data, size);
+ librevenge::RVNGRawTextGenerator generator(true);
+ STOFFDocument::parse(&input, &generator);
+ return 0;
+}
+
+// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
diff --git a/src/lib/._StarBitmap.cxx b/src/lib/._StarBitmap.cxx
deleted file mode 100644
index 14f037e..0000000
Binary files a/src/lib/._StarBitmap.cxx and /dev/null differ
diff --git a/src/lib/STOFFCell.cxx b/src/lib/STOFFCell.cxx
index d13c873..57358f6 100644
--- a/src/lib/STOFFCell.cxx
+++ b/src/lib/STOFFCell.cxx
@@ -105,12 +105,14 @@ bool STOFFCell::Format::convertDTFormat(std::string const &dtFormat, librevenge:
switch (ch) {
case 'Y':
list.insert("number:style", "long");
+ STOFF_FALLTHROUGH;
case 'y':
list.insert("librevenge:value-type", "year");
propVect.append(list);
break;
case 'B':
list.insert("number:style", "long");
+ STOFF_FALLTHROUGH;
case 'b':
case 'h':
list.insert("librevenge:value-type", "month");
@@ -123,13 +125,14 @@ bool STOFFCell::Format::convertDTFormat(std::string const &dtFormat, librevenge:
break;
case 'e':
list.insert("number:style", "long");
- // fall-through intended
+ STOFF_FALLTHROUGH;
case 'd':
list.insert("librevenge:value-type", "day");
propVect.append(list);
break;
case 'A':
list.insert("number:style", "long");
+ STOFF_FALLTHROUGH;
case 'a':
list.insert("librevenge:value-type", "day-of-week");
propVect.append(list);
@@ -137,7 +140,7 @@ bool STOFFCell::Format::convertDTFormat(std::string const &dtFormat, librevenge:
case 'H':
list.insert("number:style", "long");
- // fall-through intended
+ STOFF_FALLTHROUGH;
case 'I':
list.insert("librevenge:value-type", "hours");
propVect.append(list);
diff --git a/src/lib/STOFFChart.cxx b/src/lib/STOFFChart.cxx
index 3f2b123..6c79c50 100644
--- a/src/lib/STOFFChart.cxx
+++ b/src/lib/STOFFChart.cxx
@@ -604,6 +604,7 @@ std::ostream &operator<<(std::ostream &o, STOFFChart::TextZone const &zone)
switch (zone.m_type) {
case STOFFChart::TextZone::T_SubTitle:
o << "sub";
+ STOFF_FALLTHROUGH;
case STOFFChart::TextZone::T_Title:
o << "title";
if (zone.m_contentType==STOFFChart::TextZone::C_Cell)
diff --git a/src/lib/STOFFDebug.hxx b/src/lib/STOFFDebug.hxx
index 0c1a391..331c53a 100644
--- a/src/lib/STOFFDebug.hxx
+++ b/src/lib/STOFFDebug.hxx
@@ -215,7 +215,7 @@ public:
static void write() {}
static void reset() { }
- static void skipZone(long , long) {}
+ static void skipZone(long, long) {}
};
}
# endif
diff --git a/src/lib/STOFFSpreadsheetListener.cxx b/src/lib/STOFFSpreadsheetListener.cxx
index 1244580..a2cb111 100644
--- a/src/lib/STOFFSpreadsheetListener.cxx
+++ b/src/lib/STOFFSpreadsheetListener.cxx
@@ -1159,7 +1159,7 @@ bool STOFFSpreadsheetListener::openFrame(STOFFPosition const &pos, STOFFGraphicS
break;
case STOFFPosition::Unknown:
STOFF_DEBUG_MSG(("STOFFSpreadsheetListener::openFrame: UNKNOWN position, insert as char position\n"));
- // fallthrough intended
+ STOFF_FALLTHROUGH;
case STOFFPosition::CharBaseLine:
case STOFFPosition::Char:
if (m_ps->m_isSpanOpened)
@@ -1477,7 +1477,7 @@ void STOFFSpreadsheetListener::openSheetCell(STOFFCell const &cell, STOFFCellCon
if (format.m_format==STOFFCell::F_DATE)
break;
}
- // fall throught intended
+ STOFF_FALLTHROUGH;
case STOFFCell::F_TIME: {
if (format.m_format==STOFFCell::F_TIME)
propList.insert("librevenge:value-type", "time");
diff --git a/src/lib/STOFFTextListener.cxx b/src/lib/STOFFTextListener.cxx
index 6219593..fe3c538 100644
--- a/src/lib/STOFFTextListener.cxx
+++ b/src/lib/STOFFTextListener.cxx
@@ -1161,7 +1161,7 @@ void STOFFTextListener::insertShape(STOFFGraphicShape const &shape, STOFFGraphic
default:
#endif
STOFF_DEBUG_MSG(("STOFFTextListener::insertShape: UNKNOWN position, insert as char position\n"));
- // fallthrough intended
+ STOFF_FALLTHROUGH;
case STOFFPosition::CharBaseLine:
case STOFFPosition::Char:
if (m_ps->m_isSpanOpened)
@@ -1245,7 +1245,7 @@ bool STOFFTextListener::openFrame(STOFFPosition const &pos, STOFFGraphicStyle co
break;
case STOFFPosition::Unknown:
STOFF_DEBUG_MSG(("STOFFTextListener::openFrame: UNKNOWN position, insert as char position\n"));
- // fallthrough intended
+ STOFF_FALLTHROUGH;
case STOFFPosition::CharBaseLine:
case STOFFPosition::Char:
if (m_ps->m_isSpanOpened)
@@ -1328,7 +1328,7 @@ bool STOFFTextListener::openGroup(STOFFPosition const &pos)
default:
#endif
STOFF_DEBUG_MSG(("STOFFTextListener::openGroup: UNKNOWN position, insert as char position\n"));
- // fallthrough intended
+ STOFF_FALLTHROUGH;
case STOFFPosition::CharBaseLine:
case STOFFPosition::Char:
if (m_ps->m_isSpanOpened)
diff --git a/src/lib/StarAttribute.hxx b/src/lib/StarAttribute.hxx
index 08aba9c..d3beac7 100644
--- a/src/lib/StarAttribute.hxx
+++ b/src/lib/StarAttribute.hxx
@@ -171,7 +171,7 @@ public:
ATTR_FRM_LAYOUT_SPLIT, // 100
ATTR_FRM_CHAIN, // 101
ATTR_FRM_TEXTGRID, // 102
- ATTR_FRM_LINENUMBER , // 103
+ ATTR_FRM_LINENUMBER, // 103
ATTR_FRM_FTN_AT_TXTEND, // 104
ATTR_FRM_END_AT_TXTEND, // 105
ATTR_FRM_COLUMNBALANCE, // 106
diff --git a/src/lib/StarBitmap.cxx b/src/lib/StarBitmap.cxx
index 5a08105..b4d1656 100644
--- a/src/lib/StarBitmap.cxx
+++ b/src/lib/StarBitmap.cxx
@@ -36,6 +36,7 @@
#include <iostream>
#include <limits>
#include <sstream>
+#include <utility>
#ifdef USE_ZIP
# include <zlib.h>
@@ -84,7 +85,7 @@ struct Bitmap {
}
return true;
}
- if (m_indexDataList.size()!=size_t(m_width*m_height)) {
+ if (m_indexDataList.size()/m_width!=m_height || m_indexDataList.size()%m_width!=0) {
STOFF_DEBUG_MSG(("StarBitmapInternal::Bitmap::getPPMData: index data list's size is bad\n"));
return false;
}
@@ -315,6 +316,7 @@ bool StarBitmap::readBitmap(StarZone &zone, bool inFileHeader, long lastPos, lib
ascFile.addPos(pos);
ascFile.addNote(f.str().c_str());
input->seek(lastPos, librevenge::RVNG_SEEK_SET);
+ (void)inflateEnd(&strm);
return true;
default:
break;
@@ -343,7 +345,13 @@ bool StarBitmap::readBitmap(StarZone &zone, bool inFileHeader, long lastPos, lib
if (offset)
dataPos=beginPos+offset;
int const bitCount=bitmap.m_bitCount<=1 ? 1 : bitmap.m_bitCount<=4 ? 4 : bitmap.m_bitCount<=8 ? 8 : 24;
- int const nColors=(bitCount>8) ? 0 : bitmap.m_numColors[0] ? int(bitmap.m_numColors[0]) : int(1 << bitCount);
+ int nColors=0;
+ if (bitCount <= 8) {
+ if (bitmap.m_numColors[0] > 0 && bitmap.m_numColors[0] < (1u << bitCount))
+ nColors = int(bitmap.m_numColors[0]);
+ else
+ nColors = int(1 << bitCount);
+ }
int const numComponent=bitmap.m_hasAlphaColor ? 4 : 3;
if ((endDataPos-dInput->tell())/numComponent<nColors || dInput->tell()+numComponent*nColors > endDataPos) {
STOFF_DEBUG_MSG(("StarBitmap::readBitmap: can not read the color\n"));
@@ -501,7 +509,7 @@ bool StarBitmap::readBitmapData(STOFFInputStreamPtr &input, StarBitmapInternal::
for (int i=0; i<3; ++i) {
*input >> RGBMask[i];
uint32_t decal=0x80000000ul;
- for (int j=31; j>=0; --j, decal>>=1) {
+ for (int j=31; j>=7; --j, decal>>=1) {
if ((RGBMask[i]&decal)==0) continue;
RGBShift[i]=j-7;
break;
@@ -512,9 +520,9 @@ bool StarBitmap::readBitmapData(STOFFInputStreamPtr &input, StarBitmapInternal::
RGBMask[0]= bitmap.m_bitCount == 16 ? 0x00007c00UL : 0x00ff0000UL;
RGBMask[1]= bitmap.m_bitCount == 16 ? 0x000003e0UL : 0x0000ff00UL;
RGBMask[2]= bitmap.m_bitCount == 16 ? 0x0000001fUL : 0x000000ffUL;
- RGBShift[0]= bitmap.m_bitCount == 16 ? 7 : 16;
- RGBShift[1]= bitmap.m_bitCount == 16 ? 2 : 8;
- RGBShift[2]= bitmap.m_bitCount == 16 ? -3 : 0;
+ RGBShift[0]= bitmap.m_bitCount == 16 ? 10 : 16;
+ RGBShift[1]= bitmap.m_bitCount == 16 ? 5 : 8;
+ RGBShift[2]= bitmap.m_bitCount == 16 ? 0 : 0;
}
}
@@ -529,6 +537,10 @@ bool StarBitmap::readBitmapData(STOFFInputStreamPtr &input, StarBitmapInternal::
bitmap.m_indexDataList.resize(size_t(lastWPos),0);
uint32_t x=0, y=0;
while (true) {
+ if (input->tell() > lastPos - 1) {
+ STOFF_DEBUG_MSG(("StarBitmap::readBitmapData: at the end of the bitmap record already\n"));
+ return false;
+ }
if (y>=bitmap.m_height) break;
int nCount=int(input->readULong(1));
if (!nCount) {
diff --git a/src/lib/StarEncoding.cxx b/src/lib/StarEncoding.cxx
index efded99..94af16f 100644
--- a/src/lib/StarEncoding.cxx
+++ b/src/lib/StarEncoding.cxx
@@ -789,7 +789,7 @@ bool StarEncoding::read
0x0640, 0xFED3, 0xFED7, 0xFEDB, 0xFEDF, 0xFEE3, 0xFEE7, 0xFEEB, /* 0xE0 */
0xFEED, 0xFEEF, 0xFEF3, 0xFEBD, 0xFECC, 0xFECE, 0xFECD, 0xFEE1, /* 0xE0 */
0xFE7D, 0x0651, 0xFEE5, 0xFEE9, 0xFEEC, 0xFEF0, 0xFEF2, 0xFED0, /* 0xF0 */
- 0xFED5, 0xFEF5, 0xFEF6, 0xFEDD, 0xFED9, 0xFEF1, 0x25A0 /* 0xF0 */
+ 0xFED5, 0xFEF5, 0xFEF6, 0xFEDD, 0xFED9, 0xFEF1, 0x25A0, 0 /* 0xF0 */
};
unicode=static_cast<uint32_t>(val[c-0x80]);
break;
diff --git a/src/lib/StarEncodingChinese.cxx b/src/lib/StarEncodingChinese.cxx
index e36e2f8..62d6047 100644
--- a/src/lib/StarEncodingChinese.cxx
+++ b/src/lib/StarEncodingChinese.cxx
@@ -62,7 +62,7 @@ bool StarEncodingChinese::readChinese1
}
bool gbkOr936=encoding==StarEncoding::E_GBK || encoding==StarEncoding::E_MS_936;
bool gbt=encoding==StarEncoding::E_GBT_12345;
- bool gbkOff=gbkOr936 ? 0 : 0x61;
+ int gbkOff=gbkOr936 ? 0 : 0x61;
if (pos>=src.size()) return false;
int c=int(src[pos++]), c2=0;
if (c>=(encoding==StarEncoding::E_APPLE_CHINSIMP ? 0x83 : 0x81) &&
diff --git a/src/lib/StarFormatManager.cxx b/src/lib/StarFormatManager.cxx
index 7296458..88e3276 100644
--- a/src/lib/StarFormatManager.cxx
+++ b/src/lib/StarFormatManager.cxx
@@ -372,7 +372,7 @@ bool NumberFormatter::FormatItem::updateNumberingProperties(librevenge::RVNGProp
case 26: // nnn
case 41: // aaa
list.insert("number:style", "long");
- // fall through expected
+ STOFF_FALLTHROUGH;
case 19: // dddd
case 22: // nn
case 40: // aa
@@ -1084,8 +1084,8 @@ bool StarFormatManager::readSWPatternLCL(StarZone &zone)
f << "tknEntry,";
break;
}
- // #92986# some older versions created a wrong content index entry definition
- // fall through expected
+ // #92986# some older versions created a wrong content index entry definition
+ STOFF_FALLTHROUGH;
case 4: {
f << "tknText,";
if (!zone.readString(string)) {
diff --git a/src/lib/StarWriterStruct.cxx b/src/lib/StarWriterStruct.cxx
index 5893302..d1ad366 100644
--- a/src/lib/StarWriterStruct.cxx
+++ b/src/lib/StarWriterStruct.cxx
@@ -327,7 +327,7 @@ bool DatabaseName::read(StarZone &zone)
}
data.m_name=libstoff::getString(text);
int positions[2];
- for (int j=0; j<2; ++j) positions[i]=int(input->readULong(4));
+ for (int j=0; j<2; ++j) positions[j]=int(input->readULong(4));
data.m_selection=STOFFVec2i(positions[0],positions[1]);
m_dataList.push_back(data);
}
diff --git a/src/lib/libstaroffice_internal.hxx b/src/lib/libstaroffice_internal.hxx
index ad3abb8..edf806c 100644
--- a/src/lib/libstaroffice_internal.hxx
+++ b/src/lib/libstaroffice_internal.hxx
@@ -110,6 +110,20 @@ struct STOFF_shared_ptr_noop_deleter {
void operator()(T *) {}
};
+/** fall through attributes */
+#define STOFF_FALLTHROUGH
+#if defined(__clang__)
+# if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough)
+# undef STOFF_FALLTHROUGH
+# define STOFF_FALLTHROUGH [[clang::fallthrough]]
+# endif
+#elif defined(__GNUC__)
+# if __GNUC__>=7
+# undef STOFF_FALLTHROUGH
+# define STOFF_FALLTHROUGH __attribute__ ((fallthrough))
+# endif
+#endif
+
#if defined(__clang__) || defined(__GNUC__)
# define LIBSTOFF_ATTRIBUTE_PRINTF(fmt, arg) __attribute__((__format__(__printf__, fmt, arg)))
#else
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/libstaroffice.git
More information about the Pkg-openoffice-commits
mailing list