From a0106f83d19a2fb997ae890dea691f3b831ad569 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 13 Feb 2008 19:52:44 +0000 Subject: [PATCH] Attempt to fix #432220 --- inkscape-0.46pre1-vectors.patch | 21 +++++++++++++++++++++ inkscape.spec | 8 ++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 inkscape-0.46pre1-vectors.patch diff --git a/inkscape-0.46pre1-vectors.patch b/inkscape-0.46pre1-vectors.patch new file mode 100644 index 0000000..de93665 --- /dev/null +++ b/inkscape-0.46pre1-vectors.patch @@ -0,0 +1,21 @@ +Avoid copying a vector when start offset is beyond the end. +This fixes a segfault when compiled with gcc-4.3 (#432220) + +Lubomir Kundrak + +diff -urp inkscape-0.45.1+0.46pre1.orig/src/sp-text.cpp inkscape-0.45.1+0.46pre1/src/sp-text.cpp +--- inkscape-0.45.1+0.46pre1.orig/src/sp-text.cpp 2008-01-15 00:24:22.000000000 +0100 ++++ inkscape-0.45.1+0.46pre1/src/sp-text.cpp 2008-02-13 20:44:34.000000000 +0100 +@@ -749,8 +749,10 @@ void TextTagAttributes::mergeInto(Inksca + void TextTagAttributes::mergeSingleAttribute(std::vector *output_list, std::vector const &parent_list, unsigned parent_offset, std::vector const *overlay_list) + { + if (overlay_list == NULL) { +- output_list->resize(std::max(0, (int)parent_list.size() - (int)parent_offset)); +- std::copy(parent_list.begin() + parent_offset, parent_list.end(), output_list->begin()); ++ if (parent_offset < parent_list.size()) { ++ output_list->resize((int)parent_list.size() - (int)parent_offset); ++ std::copy(parent_list.begin() + parent_offset, parent_list.end(), output_list->begin()); ++ } + } else { + output_list->clear(); + output_list->reserve(std::max((int)parent_list.size() - (int)parent_offset, (int)overlay_list->size())); diff --git a/inkscape.spec b/inkscape.spec index 8efe522..bbe644a 100644 --- a/inkscape.spec +++ b/inkscape.spec @@ -1,6 +1,6 @@ Name: inkscape Version: 0.45.1+0.46pre1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Vector-based drawing program using SVG Group: Applications/Productivity @@ -10,6 +10,7 @@ Source0: http://download.sourceforge.net/inkscape/inkscape-%{version}.tar Patch0: inkscape-16571-cxxinclude.patch Patch1: inkscape-0.45.1-desktop.patch Patch2: inkscape-0.46pre1-gcc43.patch +Patch3: inkscape-0.46pre1-vectors.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: atk-devel @@ -45,7 +46,6 @@ Requires: python-lxml Requires(post): desktop-file-utils Requires(postun): desktop-file-utils - %description Inkscape is a vector-based drawing program, like CorelDraw® or Adobe Illustrator® from the proprietary software world, and Sketch or Karbon14 from @@ -65,6 +65,7 @@ C and C++, using the Gtk+ toolkit and optionally some Gnome libraries. %patch0 -p1 -b .cxxinclude %patch1 -p1 -b .desktop %patch2 -p1 -b .gcc43 +%patch3 -p1 -b .vectors find -type f -regex '.*\.\(cpp\|h\)' -perm +111 -exec chmod -x {} ';' find share/extensions/ -type f -regex '.*\.py' -perm +111 -exec chmod -x {} ';' dos2unix share/extensions/*.py @@ -124,6 +125,9 @@ update-desktop-database %{_datadir}/applications > /dev/null 2>&1 || : %changelog +* Wed Feb 13 2008 Lubomir Kundrak - 0.45.1+0.46pre1-3 +- Fix crash when adding text objects (#432220) + * Thu Feb 07 2008 Lubomir Kundrak - 0.45.1+0.46pre1-2 - Build with gcc-4.3