mirror of
https://gitdl.cn/https://github.com/chakralinux/gtk.git
synced 2025-01-23 17:33:32 +08:00
gimp: rebuild to strip libtool and patch some CVE
This commit is contained in:
parent
2a52ab404d
commit
73c8b98f71
@ -1,7 +1,7 @@
|
||||
pkgname=gimp
|
||||
pkgver=2.8.10
|
||||
_pkgver=2.8
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="GNU Image Manipulation Program (Development Version)"
|
||||
arch=('x86_64')
|
||||
url="http://www.gimp.org/"
|
||||
@ -19,9 +19,17 @@ options=('!makeflags')
|
||||
conflicts=('gimp')
|
||||
provides=("gimp=${pkgver}")
|
||||
install=gimp.install
|
||||
source=(ftp://ftp.gimp.org/pub/gimp/v${_pkgver}/gimp-${pkgver}.tar.bz2 linux.gpl)
|
||||
md5sums=('84c964aab7044489af69f7319bb59b47'
|
||||
'bb27bc214261d36484093e857f015f38')
|
||||
source=("http://download.gimp.org/pub/gimp/v${_pkgver}/gimp-${pkgver}.tar.bz2" "linux.gpl"
|
||||
'patch_CVE197.patch'
|
||||
'patch_CVE1913.patch'
|
||||
'freetype_location.patch')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
patch -p1 -i ../patch_CVE1913.patch
|
||||
patch -p1 -i ../patch_CVE197.patch
|
||||
patch -p1 -i ../freetype_location.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/gimp-${pkgver}"
|
||||
@ -42,3 +50,14 @@ package() {
|
||||
ln -sf gimptool-2.0.1.gz "${pkgdir}/usr/share/man/man1/gimptool.1.gz"
|
||||
ln -s gimp-${pkgver}.1.gz "${pkgdir}/usr/share/man/man1/gimp.1.gz"
|
||||
}
|
||||
|
||||
md5sums=('84c964aab7044489af69f7319bb59b47'
|
||||
'bb27bc214261d36484093e857f015f38'
|
||||
'c551e5e799858ea92c56e41ce329b763'
|
||||
'629ec0eebe7ab5c9b68fea2c8d4dfeee'
|
||||
'ca0f32cb329ddad8079f8e2c0fc75b29')
|
||||
md5sums=('84c964aab7044489af69f7319bb59b47'
|
||||
'bb27bc214261d36484093e857f015f38'
|
||||
'901643efc82fae57af466d8a0a8991ff'
|
||||
'dcc2acc9f9962a7c83ffb4243c08c469'
|
||||
'ca0f32cb329ddad8079f8e2c0fc75b29')
|
||||
|
25
gimp/freetype_location.patch
Normal file
25
gimp/freetype_location.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 6c73f28b6d87a2afd11974552a075bffec52347f Mon Sep 17 00:00:00 2001
|
||||
From: Michael Natterer <mitch@gimp.org>
|
||||
Date: Fri, 29 Nov 2013 20:57:46 +0000
|
||||
Subject: Bug 719560 - Build failure with freetype 2.5.1
|
||||
|
||||
Apply patch from su-v that fixes the freetype include to
|
||||
the madness devised and recommended by freetype.
|
||||
---
|
||||
diff --git a/app/text/gimpfont.c b/app/text/gimpfont.c
|
||||
index 4045ca9..66c6e52 100644
|
||||
--- a/app/text/gimpfont.c
|
||||
+++ b/app/text/gimpfont.c
|
||||
@@ -28,7 +28,9 @@
|
||||
|
||||
#define PANGO_ENABLE_ENGINE 1 /* Argh */
|
||||
#include <pango/pango-ot.h>
|
||||
-#include <freetype/tttables.h>
|
||||
+
|
||||
+#include <ft2build.h>
|
||||
+#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
#include "text-types.h"
|
||||
|
||||
--
|
||||
cgit v0.9.2
|
30
gimp/patch_CVE1913.patch
Normal file
30
gimp/patch_CVE1913.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 32ae0f83e5748299641cceaabe3f80f1b3afd03e Mon Sep 17 00:00:00 2001
|
||||
From: Nils Philippsen <nils@redhat.com>
|
||||
Date: Thu, 14 Nov 2013 13:29:01 +0000
|
||||
Subject: file-xwd: sanity check colormap size (CVE-2013-1913)
|
||||
|
||||
---
|
||||
diff --git a/plug-ins/common/file-xwd.c b/plug-ins/common/file-xwd.c
|
||||
index c8e1a6e..343129a 100644
|
||||
--- a/plug-ins/common/file-xwd.c
|
||||
+++ b/plug-ins/common/file-xwd.c
|
||||
@@ -466,6 +466,17 @@ load_image (const gchar *filename,
|
||||
/* Position to start of XWDColor structures */
|
||||
fseek (ifp, (long)xwdhdr.l_header_size, SEEK_SET);
|
||||
|
||||
+ /* Guard against insanely huge color maps -- gimp_image_set_colormap() only
|
||||
+ * accepts colormaps with 0..256 colors anyway. */
|
||||
+ if (xwdhdr.l_colormap_entries > 256)
|
||||
+ {
|
||||
+ g_message (_("'%s':\nIllegal number of colormap entries: %ld"),
|
||||
+ gimp_filename_to_utf8 (filename),
|
||||
+ (long)xwdhdr.l_colormap_entries);
|
||||
+ fclose (ifp);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
if (xwdhdr.l_colormap_entries > 0)
|
||||
{
|
||||
xwdcolmap = g_new (L_XWDCOLOR, xwdhdr.l_colormap_entries);
|
||||
--
|
||||
cgit v0.9.2
|
150
gimp/patch_CVE197.patch
Normal file
150
gimp/patch_CVE197.patch
Normal file
@ -0,0 +1,150 @@
|
||||
From 23f685931e5f000dd033a45c60c1e60d7f78caf4 Mon Sep 17 00:00:00 2001
|
||||
From: Nils Philippsen <nils@redhat.com>
|
||||
Date: Tue, 26 Nov 2013 09:49:42 +0000
|
||||
Subject: file-xwd: sanity check # of colors and map entries (CVE-2013-1978)
|
||||
|
||||
The number of colors in an image shouldn't be higher than the number of
|
||||
colormap entries. Additionally, consolidate post error cleanup in
|
||||
load_image().
|
||||
---
|
||||
diff --git a/plug-ins/common/file-xwd.c b/plug-ins/common/file-xwd.c
|
||||
index 343129a..4df9ce8 100644
|
||||
--- a/plug-ins/common/file-xwd.c
|
||||
+++ b/plug-ins/common/file-xwd.c
|
||||
@@ -429,9 +429,9 @@ static gint32
|
||||
load_image (const gchar *filename,
|
||||
GError **error)
|
||||
{
|
||||
- FILE *ifp;
|
||||
+ FILE *ifp = NULL;
|
||||
gint depth, bpp;
|
||||
- gint32 image_ID;
|
||||
+ gint32 image_ID = -1;
|
||||
L_XWDFILEHEADER xwdhdr;
|
||||
L_XWDCOLOR *xwdcolmap = NULL;
|
||||
|
||||
@@ -441,7 +441,7 @@ load_image (const gchar *filename,
|
||||
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
|
||||
_("Could not open '%s' for reading: %s"),
|
||||
gimp_filename_to_utf8 (filename), g_strerror (errno));
|
||||
- return -1;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
read_xwd_header (ifp, &xwdhdr);
|
||||
@@ -450,8 +450,7 @@ load_image (const gchar *filename,
|
||||
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
||||
_("Could not read XWD header from '%s'"),
|
||||
gimp_filename_to_utf8 (filename));
|
||||
- fclose (ifp);
|
||||
- return -1;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
#ifdef XWD_COL_WAIT_DEBUG
|
||||
@@ -473,12 +472,18 @@ load_image (const gchar *filename,
|
||||
g_message (_("'%s':\nIllegal number of colormap entries: %ld"),
|
||||
gimp_filename_to_utf8 (filename),
|
||||
(long)xwdhdr.l_colormap_entries);
|
||||
- fclose (ifp);
|
||||
- return -1;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
if (xwdhdr.l_colormap_entries > 0)
|
||||
{
|
||||
+ if (xwdhdr.l_colormap_entries < xwdhdr.l_ncolors)
|
||||
+ {
|
||||
+ g_message (_("'%s':\nNumber of colormap entries < number of colors"),
|
||||
+ gimp_filename_to_utf8 (filename));
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
xwdcolmap = g_new (L_XWDCOLOR, xwdhdr.l_colormap_entries);
|
||||
|
||||
read_xwd_cols (ifp, &xwdhdr, xwdcolmap);
|
||||
@@ -498,9 +503,7 @@ load_image (const gchar *filename,
|
||||
if (xwdhdr.l_file_version != 7)
|
||||
{
|
||||
g_message (_("Can't read color entries"));
|
||||
- g_free (xwdcolmap);
|
||||
- fclose (ifp);
|
||||
- return (-1);
|
||||
+ goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,9 +511,7 @@ load_image (const gchar *filename,
|
||||
{
|
||||
g_message (_("'%s':\nNo image width specified"),
|
||||
gimp_filename_to_utf8 (filename));
|
||||
- g_free (xwdcolmap);
|
||||
- fclose (ifp);
|
||||
- return (-1);
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
if (xwdhdr.l_pixmap_width > GIMP_MAX_IMAGE_SIZE
|
||||
@@ -518,27 +519,21 @@ load_image (const gchar *filename,
|
||||
{
|
||||
g_message (_("'%s':\nImage width is larger than GIMP can handle"),
|
||||
gimp_filename_to_utf8 (filename));
|
||||
- g_free (xwdcolmap);
|
||||
- fclose (ifp);
|
||||
- return (-1);
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
if (xwdhdr.l_pixmap_height <= 0)
|
||||
{
|
||||
g_message (_("'%s':\nNo image height specified"),
|
||||
gimp_filename_to_utf8 (filename));
|
||||
- g_free (xwdcolmap);
|
||||
- fclose (ifp);
|
||||
- return (-1);
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
if (xwdhdr.l_pixmap_height > GIMP_MAX_IMAGE_SIZE)
|
||||
{
|
||||
g_message (_("'%s':\nImage height is larger than GIMP can handle"),
|
||||
gimp_filename_to_utf8 (filename));
|
||||
- g_free (xwdcolmap);
|
||||
- fclose (ifp);
|
||||
- return (-1);
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
gimp_progress_init_printf (_("Opening '%s'"),
|
||||
@@ -591,11 +586,6 @@ load_image (const gchar *filename,
|
||||
}
|
||||
gimp_progress_update (1.0);
|
||||
|
||||
- fclose (ifp);
|
||||
-
|
||||
- if (xwdcolmap)
|
||||
- g_free (xwdcolmap);
|
||||
-
|
||||
if (image_ID == -1 && ! (error && *error))
|
||||
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
||||
_("XWD-file %s has format %d, depth %d and bits per pixel %d. "
|
||||
@@ -603,6 +593,17 @@ load_image (const gchar *filename,
|
||||
gimp_filename_to_utf8 (filename),
|
||||
(gint) xwdhdr.l_pixmap_format, depth, bpp);
|
||||
|
||||
+out:
|
||||
+ if (ifp)
|
||||
+ {
|
||||
+ fclose (ifp);
|
||||
+ }
|
||||
+
|
||||
+ if (xwdcolmap)
|
||||
+ {
|
||||
+ g_free (xwdcolmap);
|
||||
+ }
|
||||
+
|
||||
return image_ID;
|
||||
}
|
||||
|
||||
--
|
||||
cgit v0.9.2
|
Loading…
Reference in New Issue
Block a user