[114803] trunk/dports/graphics/gimp2

devans at macports.org devans at macports.org
Sun Dec 15 11:29:14 PST 2013


Revision: 114803
          https://trac.macports.org/changeset/114803
Author:   devans at macports.org
Date:     2013-12-15 11:29:13 -0800 (Sun, 15 Dec 2013)
Log Message:
-----------
gimp2: apply recent upstream patches.

Modified Paths:
--------------
    trunk/dports/graphics/gimp2/Portfile

Added Paths:
-----------
    trunk/dports/graphics/gimp2/files/patch-error-close-port-bz719396.diff
    trunk/dports/graphics/gimp2/files/patch-file-xwd-sanity-check-colormap-size-CVE-2013-1913.diff
    trunk/dports/graphics/gimp2/files/patch-file-xwd-sanity-check-number-colors-CVE-2013-1978.diff
    trunk/dports/graphics/gimp2/files/patch-widget-direction-set-system-locale-not-user-bz679214.diff

Modified: trunk/dports/graphics/gimp2/Portfile
===================================================================
--- trunk/dports/graphics/gimp2/Portfile	2013-12-15 19:07:43 UTC (rev 114802)
+++ trunk/dports/graphics/gimp2/Portfile	2013-12-15 19:29:13 UTC (rev 114803)
@@ -8,7 +8,7 @@
 conflicts       gimp2-devel gimp3-devel
 # please remember to update the gimp metapackage to match
 version         2.8.10
-revision        1
+revision        2
 license         {GPL-2+ LGPL}
 categories      graphics
 maintainers     devans
@@ -90,6 +90,10 @@
                 patch-brush-outline-not-displayed-bz719593.diff \
                 patch-palette-editor-not-working-new-palettes-bz719634.diff \
                 patch-plug-in-borderaverage-return-garbage-alpha-value-bz719662.diff \
+                patch-error-close-port-bz719396.diff \
+                patch-file-xwd-sanity-check-colormap-size-CVE-2013-1913.diff \
+                patch-file-xwd-sanity-check-number-colors-CVE-2013-1978.diff \
+                patch-widget-direction-set-system-locale-not-user-bz679214.diff \
                 patch-plug-ins-twain-tw_mac.c.diff
 
 platform darwin 9 {

Added: trunk/dports/graphics/gimp2/files/patch-error-close-port-bz719396.diff
===================================================================
--- trunk/dports/graphics/gimp2/files/patch-error-close-port-bz719396.diff	                        (rev 0)
+++ trunk/dports/graphics/gimp2/files/patch-error-close-port-bz719396.diff	2013-12-15 19:29:13 UTC (rev 114803)
@@ -0,0 +1,21 @@
+From f1677dea03fa3685887bdcb04f927158cbfeb15c Mon Sep 17 00:00:00 2001
+From: Kevin Cozens <kevin at ve3syb.ca>
+Date: Tue, 03 Dec 2013 01:17:05 +0000
+Subject: Fixed an error in the close-port function. Closes bug #719396.
+
+---
+diff --git a/plug-ins/script-fu/scripts/script-fu.init b/plug-ins/script-fu/scripts/script-fu.init
+index 120ecc7..9f8c5a6 100644
+--- plug-ins/script-fu/scripts/script-fu.init
++++ plug-ins/script-fu/scripts/script-fu.init
+@@ -603,7 +603,7 @@
+ 
+ (define (close-port p)
+      (cond
+-          ((input-output-port? p) (close-input-port (close-output-port p)))
++          ((input-output-port? p) (close-input-port p) (close-output-port p))
+           ((input-port? p) (close-input-port p))
+           ((output-port? p) (close-output-port p))
+           (else (throw "Not a port" p))))
+--
+cgit v0.9.2

Added: trunk/dports/graphics/gimp2/files/patch-file-xwd-sanity-check-colormap-size-CVE-2013-1913.diff
===================================================================
--- trunk/dports/graphics/gimp2/files/patch-file-xwd-sanity-check-colormap-size-CVE-2013-1913.diff	                        (rev 0)
+++ trunk/dports/graphics/gimp2/files/patch-file-xwd-sanity-check-colormap-size-CVE-2013-1913.diff	2013-12-15 19:29:13 UTC (rev 114803)
@@ -0,0 +1,31 @@
+From 7f2322e4ced8ba393abc5a0aa15a607f340f0db8 Mon Sep 17 00:00:00 2001
+From: Nils Philippsen <nils at redhat.com>
+Date: Thu, 14 Nov 2013 13:29:01 +0000
+Subject: file-xwd: sanity check colormap size (CVE-2013-1913)
+
+(cherry picked from commit 32ae0f83e5748299641cceaabe3f80f1b3afd03e)
+---
+diff --git a/plug-ins/common/file-xwd.c b/plug-ins/common/file-xwd.c
+index 3240f7e..2625f69 100644
+--- plug-ins/common/file-xwd.c
++++ plug-ins/common/file-xwd.c
+@@ -461,6 +461,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

Added: trunk/dports/graphics/gimp2/files/patch-file-xwd-sanity-check-number-colors-CVE-2013-1978.diff
===================================================================
--- trunk/dports/graphics/gimp2/files/patch-file-xwd-sanity-check-number-colors-CVE-2013-1978.diff	                        (rev 0)
+++ trunk/dports/graphics/gimp2/files/patch-file-xwd-sanity-check-number-colors-CVE-2013-1978.diff	2013-12-15 19:29:13 UTC (rev 114803)
@@ -0,0 +1,152 @@
+From 0ffb3b6753aad00512349bba31bf5113054c6a0e Mon Sep 17 00:00:00 2001
+From: Nils Philippsen <nils at 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().
+
+(cherry picked from commit 23f685931e5f000dd033a45c60c1e60d7f78caf4)
+---
+diff --git a/plug-ins/common/file-xwd.c b/plug-ins/common/file-xwd.c
+index 2625f69..ba07afd 100644
+--- plug-ins/common/file-xwd.c
++++ plug-ins/common/file-xwd.c
+@@ -424,9 +424,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;
+ 
+@@ -436,7 +436,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);
+@@ -445,8 +445,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
+@@ -468,12 +467,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);
+@@ -493,9 +498,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;
+         }
+     }
+ 
+@@ -503,9 +506,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
+@@ -513,27 +514,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'"),
+@@ -582,11 +577,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. "
+@@ -594,6 +584,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

Added: trunk/dports/graphics/gimp2/files/patch-widget-direction-set-system-locale-not-user-bz679214.diff
===================================================================
--- trunk/dports/graphics/gimp2/files/patch-widget-direction-set-system-locale-not-user-bz679214.diff	                        (rev 0)
+++ trunk/dports/graphics/gimp2/files/patch-widget-direction-set-system-locale-not-user-bz679214.diff	2013-12-15 19:29:13 UTC (rev 114803)
@@ -0,0 +1,33 @@
+From c1314499ffa6aa4cf7543e00b028d987209fa6fc Mon Sep 17 00:00:00 2001
+From: Jehan <jehan at girinstud.io>
+Date: Mon, 09 Dec 2013 06:31:48 +0000
+Subject: Bug 679214 - widget direction set to system locale, not user-set lang
+
+In particular a RTL-localized OS, where the user sets GIMP to a LTR lang
+would still have a RTL UI (menus, etc.). And vice versa.
+(cherry picked from commit 735f00b886283f0a8fcee5ac9b414543f19a6ef4)
+---
+diff --git a/app/gui/gui.c b/app/gui/gui.c
+index faaa91b..3f65546 100644
+--- app/gui/gui.c
++++ app/gui/gui.c
+@@ -198,6 +198,17 @@ gui_init (Gimp     *gimp,
+ 
+   the_gui_gimp = gimp;
+ 
++  /* Normally this should have been taken care of during command line
++   * parsing as a post-parse hook of gtk_get_option_group(), using the
++   * system locales.
++   * But user config may have overriden the language, therefore we must
++   * check the widget directions again.
++   */
++  if (g_strcmp0 (dgettext ("gtk20", "default:LTR"), "default:RTL") == 0)
++    gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
++  else
++    gtk_widget_set_default_direction (GTK_TEXT_DIR_LTR);
++
+   gui_unique_init (gimp);
+ 
+   gimp_widgets_init (gui_help_func,
+--
+cgit v0.9.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20131215/0ef4159f/attachment-0001.html>


More information about the macports-changes mailing list