Merge branch 'master' into el6

Conflicts:
	ocaml-camlimages.spec
This commit is contained in:
Bruno Wolff III 2012-03-12 08:09:17 -05:00
commit d23e07018c
6 changed files with 102 additions and 286 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
camlimages-2.2.0-htmlref.tar.gz camlimages-2.2.0-htmlref.tar.gz
camlimages-2.2.0.tgz camlimages-2.2.0.tgz
camlimages-3.0.1.tar.gz camlimages-3.0.1.tar.gz
camlimages-3.0.2.tgz
/v4.0.1.tar.gz

View File

@ -1,52 +0,0 @@
diff -ur camlimages-3.0.1.orig/examples/liv/liv.ml camlimages-3.0.1/examples/liv/liv.ml
--- camlimages-3.0.1.orig/examples/liv/liv.ml 2006-09-29 14:21:41.000000000 +0100
+++ camlimages-3.0.1/examples/liv/liv.ml 2008-11-03 17:18:02.000000000 +0000
@@ -21,14 +21,14 @@
open Livmisc;;
open Gui;;
-open Display;;
+open Livdisplay;;
open Tout;;
open Gc;;
exception Skipped;;
-let base_filters = ref ([] : Display.filter list);;
+let base_filters = ref ([] : Livdisplay.filter list);;
let r = Gc.get () in
r.max_overhead <- 0; Gc.set r;
@@ -52,15 +52,15 @@
"-root",
Arg.String
(function
- | "center" -> Display.root_mode := `CENTER
- | "random" -> Display.root_mode := `RANDOM
+ | "center" -> Livdisplay.root_mode := `CENTER
+ | "random" -> Livdisplay.root_mode := `RANDOM
| _ -> raise (Failure "root mode")),
": on root [center|random]";
"-transition",
Arg.String
(function
- | "myst" -> Display.transition := `MYST
- | "transparent" -> Display.transition := `TRANSPARENT
+ | "myst" -> Livdisplay.transition := `MYST
+ | "transparent" -> Livdisplay.transition := `TRANSPARENT
| _ -> raise (Failure "transition")),
": transition [myst|transparent]";
"-transparentborder",
diff -ur camlimages-3.0.1.orig/examples/liv/Makefile.am camlimages-3.0.1/examples/liv/Makefile.am
--- camlimages-3.0.1.orig/examples/liv/Makefile.am 2007-05-21 19:54:32.000000000 +0100
+++ camlimages-3.0.1/examples/liv/Makefile.am 2008-11-03 17:15:54.000000000 +0000
@@ -23,7 +23,7 @@
seq.ml \
tout.ml \
enhance.ml \
- display.ml \
+ livdisplay.ml \
viewer.ml \
edge.ml \
pathfind.ml \

View File

@ -1,81 +0,0 @@
--- camlimages-3.0.1.orig/src/pngread.c 2007-01-18 10:29:57.000000000 +0000
+++ camlimages-3.0.1.oversized/src/pngread.c 2009-07-03 15:51:00.000000000 +0100
@@ -15,6 +15,8 @@
#include "config.h"
#endif
+#include <limits.h>
+
#include <png.h>
#include <caml/mlvalues.h>
@@ -26,6 +28,12 @@
#define PNG_TAG_INDEX16 2
#define PNG_TAG_INDEX4 3
+/* Test if x or y are negative, or if multiplying x * y would cause an
+ * arithmetic overflow.
+ */
+#define oversized(x, y) \
+ ((x) < 0 || (y) < 0 || ((y) != 0 && (x) > INT_MAX / (y)))
+
value read_png_file_as_rgb24( name )
value name;
{
@@ -81,6 +89,9 @@
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
&interlace_type, NULL, NULL);
+ if (oversized (width, height))
+ failwith ("png error: image contains oversized or bogus width and height");
+
if ( color_type == PNG_COLOR_TYPE_GRAY ||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA ) {
png_set_gray_to_rgb(png_ptr);
@@ -102,10 +113,16 @@
rowbytes = png_get_rowbytes(png_ptr, info_ptr);
+ if (oversized (rowbytes, height))
+ failwith ("png error: image contains oversized or bogus rowbytes and height");
+
{
int i;
png_bytep *row_pointers;
+ if (oversized (sizeof (png_bytep), height))
+ failwith ("png error: image contains oversized or bogus height");
+
row_pointers = (png_bytep*) stat_alloc(sizeof(png_bytep) * height);
res = alloc_tuple(3);
@@ -235,6 +252,9 @@
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
&interlace_type, NULL, NULL);
+ if (oversized (width, height))
+ failwith ("png error: image contains oversized or bogus width and height");
+
if ( color_type == PNG_COLOR_TYPE_GRAY ||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA ) {
png_set_gray_to_rgb(png_ptr);
@@ -251,6 +271,9 @@
rowbytes = png_get_rowbytes(png_ptr, info_ptr);
+ if (oversized (rowbytes, height))
+ failwith ("png error: image contains oversized or bogus rowbytes and height");
+
/*
fprintf(stderr, "pngread.c: actual loading\n"); fflush(stderr);
*/
@@ -259,6 +282,9 @@
png_bytep *row_pointers;
char mesg[256];
+ if (oversized (sizeof (png_bytep), height))
+ failwith ("png error: image contains oversized or bogus height");
+
row_pointers = (png_bytep*)stat_alloc(sizeof(png_bytep) * height);
res = alloc_tuple(3);

View File

@ -0,0 +1,58 @@
--- src/pngwrite.c.libpng 2011-06-22 13:04:32.000000000 -0500
+++ src/pngwrite.c 2012-01-29 13:58:34.231905872 -0600
@@ -62,7 +62,7 @@
}
/* error handling */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
@@ -171,7 +171,7 @@
}
/* error handling */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
--- src/pngread.c.libpng 2012-01-29 14:00:42.285180786 -0600
+++ src/pngread.c 2012-01-29 14:02:24.978232543 -0600
@@ -69,7 +69,7 @@
}
/* error handling */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fclose(fp);
@@ -134,7 +134,7 @@
png_set_rows(png_ptr, info_ptr, row_pointers);
/* Later, we can return something */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fclose(fp);
@@ -243,7 +243,7 @@
}
/* error handling */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fclose(fp);
@@ -302,7 +302,7 @@
png_set_rows(png_ptr, info_ptr, row_pointers);
/* Later, we can return something */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fclose(fp);

View File

@ -1,29 +1,24 @@
%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%define debug_package %{nil} %define debug_package %{nil}
%define _default_patch_fuzz 2
Name: ocaml-camlimages Name: ocaml-camlimages
Version: 3.0.1 Version: 4.0.1
Release: 12%{?dist}.1 Release: 2%{?dist}
Summary: OCaml image processing library Summary: OCaml image processing library
Group: Development/Libraries Group: Development/Libraries
License: LGPLv2 with exceptions License: LGPLv2 with exceptions
URL: http://gallium.inria.fr/camlimages/ URL: http://cristal.inria.fr/camlimages/eng.html
Source0: http://gallium.inria.fr/camlimages/camlimages-%{version}.tar.gz
Source0: https://bitbucket.org/camlspotter/camlimages/get/v4.0.1.tar.gz
# This file isn't published any more (that I could find).
# It's probably dated but at least should provide some info on how to
# use the library.
Source1: camlimages-2.2.0-htmlref.tar.gz Source1: camlimages-2.2.0-htmlref.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
ExcludeArch: sparc64 s390 s390x
Patch0: camlimages-3.0.1-display-module.patch Patch0: ocaml-camlimages-libpng15.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=509531#c4 BuildRequires: ocaml, ocaml-findlib-devel, ocaml-omake
Patch1: camlimages-oversized-png-check-CVE-2009-2295.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=528732
Patch2: camlimages-oversized-tiff-check-CVE-2009-3296.patch
BuildRequires: ocaml >= 3.10.1
BuildRequires: ocaml-lablgtk-devel BuildRequires: ocaml-lablgtk-devel
BuildRequires: ocaml-x11 BuildRequires: ocaml-x11
BuildRequires: lablgtk, libpng-devel, libjpeg-devel BuildRequires: lablgtk, libpng-devel, libjpeg-devel
@ -31,29 +26,18 @@ BuildRequires: libXpm-devel, ghostscript-devel, freetype-devel
BuildRequires: giflib-devel BuildRequires: giflib-devel
BuildRequires: libtiff-devel BuildRequires: libtiff-devel
BuildRequires: gtk2-devel BuildRequires: gtk2-devel
BuildRequires: libtool, automake, autoconf
%define _use_internal_dependency_generator 0
%define __find_requires /usr/lib/rpm/ocaml-find-requires.sh
%define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
%description %description
CamlImages is an image processing library for Objective CAML, which provides: This is an image processing library, which provides some basic
basic functions for image processing and loading/saving, various image file functions of image processing and loading/saving various image file
formats (hence providing a translation facility from format to format), formats. In addition the library can handle huge images that cannot be
and an interface with the Caml graphics library allows to display images (or can hardly be) stored into the memory (the library automatically
in the Graphics module screen and to mix them with Caml drawings creates swap files and escapes them to reduce the memory usage).
In addition, the library can handle huge images that cannot be (or can hardly
be) stored into the main memory (the library then automatically creates swap
files and escapes them to reduce the memory usage).
%package devel %package devel
Summary: Development files for camlimages Summary: Development files for camlimages
Group: Development/Libraries Group: Development/Libraries
Requires: %{name} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel %description devel
@ -62,145 +46,50 @@ developing applications using camlimages
Includes documentation provided by ocamldoc Includes documentation provided by ocamldoc
%prep %prep
%setup -q -n camlimages-%{version} -a 1 %setup -q -n camlspotter-camlimages-c803efa9d5d3
%setup -q -T -D -a 1 -n camlspotter-camlimages-c803efa9d5d3
# Gdk.Display submodule clashes with the Display module in %patch0 -b .libpng
# the examples/liv directory, so rename it:
%patch0 -p1
%patch1 -p1
%patch2 -p1
aclocal -I .
automake
autoconf
mv examples/liv/display.ml examples/liv/livdisplay.ml
%build %build
%configure omake
make
%install %install
rm -rf $RPM_BUILD_ROOT # These rules work if the library uses 'ocamlfind install' to install itself.
make install ocamlsitelibdir=%{_libdir}/ocaml/camlimages DESTDIR=$RPM_BUILD_ROOT export DESTDIR=$RPM_BUILD_ROOT
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
omake install
strip $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/dllcamlimages.so strip $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so
%clean
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/share/doc/ocaml-camlimages-4.0.1
cp -pr License.txt htmlref $RPM_BUILD_ROOT/usr/share/doc/ocaml-camlimages-4.0.1
%files %files
%defattr(-,root,root,-) %doc README License.txt
%doc INSTALL README
%{_libdir}/ocaml/camlimages %{_libdir}/ocaml/camlimages
%{_libdir}/ocaml/stublibs/*.so
%if %opt
%exclude %{_libdir}/ocaml/camlimages/*.a %exclude %{_libdir}/ocaml/camlimages/*.a
%exclude %{_libdir}/ocaml/camlimages/*.cmxa %exclude %{_libdir}/ocaml/camlimages/*.cmxa
%endif # There aren't any *.cmx files
#%exclude %{_libdir}/ocaml/camlimages/*.cmx
%exclude %{_libdir}/ocaml/camlimages/*.mli %exclude %{_libdir}/ocaml/camlimages/*.mli
%{_libdir}/ocaml/stublibs/*.so
%{_libdir}/ocaml/stublibs/*.so.owner
%files devel %files devel
%defattr(-,root,root,-) %doc htmlref
%doc doc/*.{html,jpg}
%if %opt
%{_libdir}/ocaml/camlimages/*.a %{_libdir}/ocaml/camlimages/*.a
%{_libdir}/ocaml/camlimages/*.cmxa %{_libdir}/ocaml/camlimages/*.cmxa
%endif # There aren't any *.cmx files
#%{_libdir}/ocaml/camlimages/*.cmx
%{_libdir}/ocaml/camlimages/*.mli %{_libdir}/ocaml/camlimages/*.mli
%changelog %changelog
* Fri Oct 16 2009 Richard W.M. Jones <rjones@redhat.com> - 3.0.1-12.fc12.1 * Sat Mar 10 2012 Bruno Wolff III <bruno@wolff.to> - 4.0.1-2
- ocaml-camlimages: TIFF reader multiple integer overflows - Fixup "should fixes" from review
(CVE 2009-3296 / RHBZ#528732).
* Tue Sep 29 2009 Richard W.M. Jones <rjones@redhat.com> - 3.0.1-12 * Sun Jan 29 2012 Bruno Wolff III <bruno@wolff.to> - 4.0.1-1
- Force rebuild against newer lablgtk. - Resurrect ocaml-camlimages
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Fri Jul 3 2009 Richard W.M. Jones <rjones@redhat.com> - 3.0.1-10
- ocaml-camlimages: PNG reader multiple integer overflows
(CVE 2009-2295 / RHBZ#509531).
* Sat May 23 2009 Richard W.M. Jones <rjones@redhat.com> - 3.0.1-8
- Rebuild for OCaml 3.11.1
* Thu Apr 16 2009 S390x secondary arch maintainer <fedora-s390x@lists.fedoraproject.org>
- ExcludeArch sparc64, s390, s390x as we don't have OCaml on those archs
(added sparc64 per request from the sparc maintainer)
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Sat Feb 7 2009 Richard W.M. Jones <rjones@redhat.com> - 3.0.1-6
- Rebuild against updated lablgtk.
* Fri Dec 5 2008 Richard W.M. Jones <rjones@redhat.com> - 3.0.1-5
- Rebuild.
* Thu Dec 4 2008 Richard W.M. Jones <rjones@redhat.com> - 3.0.1-4
- Rebuild.
* Mon Nov 3 2008 Richard W.M. Jones <rjones@redhat.com> - 3.0.1-3
- +BR gtk2-devel.
- +BR ocaml-x11.
* Mon Nov 3 2008 Richard W.M. Jones <rjones@redhat.com> - 3.0.1-1
- Home page moved (fixes rhbz 468158).
- New upstream version 3.0.1 and multiple build fixes for this.
- License is really LGPLv2 with the OCaml linking exception.
- Removed the DESTDIR patch.
- Build tiff support.
- Run it through rpmlint and fix all problems.
* Thu Aug 28 2008 Richard W.M. Jones <rjones@redhat.com> - 2.2.0-13
- Rebuild with patch fuzz.
* Mon Aug 11 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.0-12
- fix license tag
* Wed Apr 23 2008 Richard W.M. Jones <rjones@redhat.com> - 2.2.0-11
- Rebuild for OCaml 3.10.2
* Sat Mar 1 2008 Richard W.M. Jones <rjones@redhat.com> 2.2.0-10
- Rebuild for ppc64.
* Wed Feb 13 2008 Richard W.M. Jones <rjones@redhat.com> 2.2.0-9
- Rebuild for OCaml 3.10.1
- Fix paths to conform to packaging policy.
* Wed May 09 2007 Nigel Jones <dev@nigelj.com> 2.2.0-8
- Exclude ppc64 builds due to missing ocaml
* Fri May 04 2007 Nigel Jones <dev@nigelj.com> 2.2.0-7
- Change to Makefile patch to move .so files to stublibs
- Rename to ocaml-camlimages
- Other changes per review
* Thu May 03 2007 Nigel Jones <dev@nigelj.com> 2.2.0-6
- Include .*a files just to make sure
* Thu May 03 2007 Nigel Jones <dev@nigelj.com> 2.2.0-5
- Revert -4 changes
- Remove excludedirs patch, replace with a sed
- Provide html documentation generated from running ocaml-ocamldoc
* Thu Apr 26 2007 Nigel Jones <dev@nigelj.com> 2.2.0-4
- Add Provides: camlimages-static, and LICENSE to -devel docs
* Thu Apr 12 2007 Nigel Jones <dev@nigelj.com> 2.2.0-3
- Remove .a & .o files
* Wed Apr 11 2007 Nigel Jones <dev@nigelj.com> 2.2.0-2
- Add missing dependencies
* Tue Apr 10 2007 Nigel Jones <dev@nigelj.com> 2.2.0-1
- Initial spec file

View File

@ -1,2 +1,2 @@
d6b9494b56a72b65fd302d1858efff7c v4.0.1.tar.gz
fb1633c9c8df0b2b2d0f892d8c4ac2ee camlimages-2.2.0-htmlref.tar.gz fb1633c9c8df0b2b2d0f892d8c4ac2ee camlimages-2.2.0-htmlref.tar.gz
ecacc0ecac17b5b9af1da97f68a814a0 camlimages-3.0.1.tar.gz