- Fix segfault in XPM loader (#156058).

This commit is contained in:
Michael Schwendt 2005-05-09 19:28:56 +00:00
parent 626be02d47
commit d36f8bba9e
2 changed files with 46 additions and 1 deletions

View File

@ -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)
{

View File

@ -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 <mschwendt[AT]users.sf.net> - 1.2.0-8.fc4
- Fix segfault in XPM loader (#156058).
* Tue Apr 5 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.2.0-7.fc4
- Fix broken pkgconfig file.