From 941d037eb2ed83d997dcc80cf44d121bd2b3420d Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Sep 18 2006 20:17:57 +0000 Subject: - memory leak (#207006) --- diff --git a/jasper-1.701-0-memory_leak.patch b/jasper-1.701-0-memory_leak.patch new file mode 100644 index 0000000..7fcb77a --- /dev/null +++ b/jasper-1.701-0-memory_leak.patch @@ -0,0 +1,28 @@ +diff -ur jasper-1.701.0/src/libjasper/base/jas_stream.c jasper-1.701.0-local/src/libjasper/base/jas_stream.c +--- jasper-1.701.0/src/libjasper/base/jas_stream.c 2004-02-09 07:04:40.000000000 +0530 ++++ jasper-1.701.0-local/src/libjasper/base/jas_stream.c 2005-10-23 02:08:06.145589016 +0530 +@@ -361,11 +361,11 @@ + } + obj->fd = -1; + obj->flags = 0; +- obj->pathname[0] = '\0'; ++ strncpy(obj->pathname, "jasXXXXXX", sizeof(obj->pathname)); + stream->obj_ = obj; + + /* Choose a file name. */ +- tmpnam(obj->pathname); ++ mkstemp(obj->pathname); + + /* Open the underlying file. */ + if ((obj->fd = open(obj->pathname, O_CREAT | O_EXCL | O_RDWR | O_TRUNC | O_BINARY, +diff -ur jasper-1.701.0/src/libjasper/jpg/jpg_enc.c jasper-1.701.0-local/src/libjasper/jpg/jpg_enc.c +--- jasper-1.701.0/src/libjasper/jpg/jpg_enc.c 2004-02-09 07:04:41.000000000 +0530 ++++ jasper-1.701.0-local/src/libjasper/jpg/jpg_enc.c 2005-10-23 02:09:02.526017888 +0530 +@@ -331,6 +331,7 @@ + rewind(output_file); + jpg_copyfiletostream(out, output_file); + fclose(output_file); ++ jas_matrix_destroy(src_mgr->data); + output_file = 0; + + return 0; diff --git a/jasper.spec b/jasper.spec index 8537019..74293a3 100644 --- a/jasper.spec +++ b/jasper.spec @@ -12,7 +12,7 @@ Summary: Implementation of the JPEG-2000 standard, Part 1 Name: jasper Group: System Environment/Libraries Version: 1.701.0 -Release: 13%{?dist} +Release: 14%{?dist} License: JasPer License Version 2.0 %if "%{?geo:1}" == "1" @@ -29,6 +29,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Patch1: jasper-1.701.0-GL.patch # autoconf/automake bits of patch1 Patch2: jasper-1.701.0-GL-ac.patch +# memory leak, see +# http://gyachi.sourceforge.net/download.shtml +# http://ayttm.sourceforge.net/files.shtml +# http://ayttm.sourceforge.net/jasper-memory-leak-1.701.0.patch.gz +Patch3: jasper-1.701.0-memory_leak.patch BuildRequires: automake BuildRequires: libjpeg-devel @@ -56,6 +61,7 @@ Requires: libjpeg-devel %setup -q -n %{name}-%{version}%{?geo:.GEO} %patch1 -p1 -b .GL +%patch3 -p1 -b .memleak %if "%{?geo:1}" == "1" chmod +x configure configure.ac @@ -93,7 +99,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la %files -%defattr(-,root,root) +%defattr(-,root,root,-) %doc COPYRIGHT LICENSE NEWS README %{_bindir}/imgcmp %{_bindir}/jiv @@ -102,7 +108,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la %{_libdir}/lib*.so.* %files devel -%defattr(-,root,root) +%defattr(-,root,root,-) %doc doc/* %{_includedir}/jasper/ %{_libdir}/lib*.so @@ -118,6 +124,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Sep 18 2006 Rex Dieter 1.701.0-14 +- memory leak (#207006) + * Tue Aug 29 2006 Rex Dieter 1.701.0-13 - fc6 respin