From d36f8bba9ecc08633d60a9d43e7394acc44bb935 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Mon, 9 May 2005 19:28:56 +0000 Subject: [PATCH] - Fix segfault in XPM loader (#156058). --- imlib2-1.2.0-xpmcescape.patch | 40 +++++++++++++++++++++++++++++++++++ imlib2.spec | 7 +++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 imlib2-1.2.0-xpmcescape.patch diff --git a/imlib2-1.2.0-xpmcescape.patch b/imlib2-1.2.0-xpmcescape.patch new file mode 100644 index 0000000..8fddda8 --- /dev/null +++ b/imlib2-1.2.0-xpmcescape.patch @@ -0,0 +1,40 @@ +diff -Nur imlib2-1.2.0-orig/src/modules/loaders/loader_xpm.c imlib2-1.2.0/src/modules/loaders/loader_xpm.c +--- imlib2-1.2.0-orig/src/modules/loaders/loader_xpm.c 2005-01-04 04:28:52.000000000 +0100 ++++ imlib2-1.2.0/src/modules/loaders/loader_xpm.c 2005-05-09 21:19:22.000000000 +0200 +@@ -108,7 +108,7 @@ + FILE *f; + + int pc, c, i, j, k, w, h, ncolors, cpp, comment, transp, +- quote, context, len, done, r, g, b; ++ quote, context, len, done, r, g, b, backslash; + char *line, s[256], tok[128], col[256]; + int lsz = 256; + struct _cmap { +@@ -163,6 +163,7 @@ + pixels = 0; + count = 0; + line = malloc(lsz); ++ backslash = 0; + memset(lookup, 0, sizeof(lookup)); + while (!done) + { +@@ -645,7 +646,18 @@ + c = 32; + else if (c > 127) + c = 127; +- line[i++] = c; ++ if ( c=='\\' ) { ++ if ( ++backslash<2 ) { ++ line[i++] = c; ++ } ++ else { ++ backslash = 0; ++ } ++ } ++ else { ++ backslash = 0; ++ line[i++] = c; ++ } + } + if (i >= lsz) + { diff --git a/imlib2.spec b/imlib2.spec index 388d8a0..da68069 100644 --- a/imlib2.spec +++ b/imlib2.spec @@ -1,12 +1,13 @@ Summary: Graphic library for file loading, saving, rendering, and manipulation Name: imlib2 Version: 1.2.0 -Release: 7.fc4 +Release: 8.fc4 License: BSD Group: System Environment/Libraries URL: http://www.enlightenment.org/pages/imlib2.html Source0: http://download.sf.net/enlightenment/%{name}-%{version}.tar.gz Patch0: imlib2-1.2.0-configure-xlib64.patch +Patch1: imlib2-1.2.0-xpmcescape.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildRequires: XFree86-devel libjpeg-devel libpng-devel libtiff-devel BuildRequires: libungif-devel freetype-devel libtool bzip2-devel %{__perl} @@ -40,6 +41,7 @@ long description of the differences. %ifarch x86_64 %patch0 -b .patch0 %endif +%patch1 -p1 -b .xpmcescape # loaders need to link with the main lib %{__perl} -pi -e \ 's|^(\w+_la_LDFLAGS .*)|$1 -L\$(top_builddir)/src/lib| ; @@ -122,6 +124,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon May 9 2005 Michael Schwendt - 1.2.0-8.fc4 +- Fix segfault in XPM loader (#156058). + * Tue Apr 5 2005 Michael Schwendt - 1.2.0-7.fc4 - Fix broken pkgconfig file.