summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nonprism/gthumb/0001-Do-not-process-bitmap-thumbnails-with-invalid-color-.patch40
-rw-r--r--nonprism/gthumb/PKGBUILD9
2 files changed, 46 insertions, 3 deletions
diff --git a/nonprism/gthumb/0001-Do-not-process-bitmap-thumbnails-with-invalid-color-.patch b/nonprism/gthumb/0001-Do-not-process-bitmap-thumbnails-with-invalid-color-.patch
new file mode 100644
index 000000000..e7989509e
--- /dev/null
+++ b/nonprism/gthumb/0001-Do-not-process-bitmap-thumbnails-with-invalid-color-.patch
@@ -0,0 +1,40 @@
+From 2019d1ed9d3cc6085598b92c2001690fb41af8f7 Mon Sep 17 00:00:00 2001
+From: Jan de Groot <jgc@archlinux.org>
+Date: Mon, 13 Feb 2017 13:28:27 +0000
+Subject: [PATCH] Do not process bitmap thumbnails with invalid color settings.
+
+Libraw sets these to 0 in an excption handler, we should not assert fatal when processing such an image.
+---
+ extensions/raw_files/main.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/extensions/raw_files/main.c b/extensions/raw_files/main.c
+index 6cf2ff8e..726385a3 100644
+--- a/extensions/raw_files/main.c
++++ b/extensions/raw_files/main.c
+@@ -267,12 +267,16 @@ _cairo_image_surface_create_from_raw (GInputStream *istream,
+ error);
+ break;
+ case LIBRAW_THUMBNAIL_BITMAP:
+- image = _libraw_read_bitmap_data (raw_data->thumbnail.twidth,
+- raw_data->thumbnail.theight,
+- raw_data->thumbnail.tcolors,
+- 8,
+- (guchar *) raw_data->thumbnail.thumb,
+- raw_data->thumbnail.tlength);
++ if (raw_data->thumbnail.tcolors > 0 && raw_data->thumbnail.tcolors < 4) {
++ image = _libraw_read_bitmap_data (raw_data->thumbnail.twidth,
++ raw_data->thumbnail.theight,
++ raw_data->thumbnail.tcolors,
++ 8,
++ (guchar *) raw_data->thumbnail.thumb,
++ raw_data->thumbnail.tlength);
++ } else {
++ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA, "Unsupported data format");
++ }
+ break;
+ default:
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA, "Unsupported data format");
+--
+2.11.1
+
diff --git a/nonprism/gthumb/PKGBUILD b/nonprism/gthumb/PKGBUILD
index fb4dcb993..b094a041a 100644
--- a/nonprism/gthumb/PKGBUILD
+++ b/nonprism/gthumb/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 285668 2017-01-11 13:15:17Z arojas $
+# $Id: PKGBUILD 288880 2017-02-13 13:39:34Z jgc $
# Maintainer (Arch): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor (Arch): Jan de Groot <jgc@archlinux.org>
# Contributor (Arch): Tobias Kieslich <tobias@justdreams.de>
@@ -7,7 +7,7 @@
pkgname=gthumb
pkgver=3.4.4.1
-pkgrel=2.nonprism1
+pkgrel=3.nonprism1
pkgdesc="Image browser and viewer for the GNOME Desktop, without support for unsafe and dangerous for privacy protocols"
url="https://wiki.gnome.org/Apps/gthumb"
arch=(i686 x86_64)
@@ -24,9 +24,11 @@ optdepends=('libraw: read RAW files'
'brasero: burn discs'
'liboauth: web albums')
_commit=849e68f5ba606c25988a1e9e6669519734a7449a # gthumb-3-4
-source=("git://git.gnome.org/gthumb#commit=$_commit"
+source=("git+https://git.gnome.org/browse/gthumb#commit=$_commit"
+ 0001-Do-not-process-bitmap-thumbnails-with-invalid-color-.patch
nonprism.patch)
sha256sums=('SKIP'
+ '9cdffadd2b2c21904a997b4ab4ef311c18a59dfa6a3b236570af7f1465a36c60'
'b1cd2463ab6475ce91a2b2e83dfcb1835ffaa9640c59d7bcfbe611163327fa45')
pkgver() {
@@ -39,6 +41,7 @@ prepare() {
# Fixup tags for pkgver()
git tag -f 3.4.4.1 849e68f5ba606c25988a1e9e6669519734a7449a
NOCONFIGURE=1 ./autogen.sh
+ patch -Np1 -i ../0001-Do-not-process-bitmap-thumbnails-with-invalid-color-.patch
patch -Np1 -i ../nonprism.patch
}