don't dereference NULL preview objects when quitting (#963696)

This commit is contained in:
Nils Philippsen 2013-05-17 14:26:22 +02:00
parent 76243283a2
commit 31dc8f91a9
3 changed files with 63 additions and 48 deletions

View File

@ -0,0 +1,44 @@
From 7b47e322551f1c2ffe38e2f6f8cfde1b9de084ec Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Fri, 17 May 2013 14:14:55 +0200
Subject: [PATCH] patch: null-preview-crash
Squashed commit of the following:
commit c9b1ee0aaf9701f6d3bd14b32354fa5b2bcd1433
Author: Nils Philippsen <nils@redhat.com>
Date: Fri May 17 14:14:28 2013 +0200
don't dereference xsane.preview if it is NULL
---
src/xsane-front-gtk.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/xsane-front-gtk.c b/src/xsane-front-gtk.c
index 08761a0..8502c03 100644
--- a/src/xsane-front-gtk.c
+++ b/src/xsane-front-gtk.c
@@ -1713,7 +1713,7 @@ void xsane_update_param(void *arg)
gtk_label_set(GTK_LABEL(xsane.info_label), buf);
- if (xsane.preview->surface_unit == SANE_UNIT_MM)
+ if (xsane.preview && xsane.preview->surface_unit == SANE_UNIT_MM)
{
double dx, dy;
@@ -1728,7 +1728,10 @@ void xsane_update_param(void *arg)
xsane_update_histogram(TRUE /* update raw */);
- preview_display_valid(xsane.preview);
+ if (xsane.preview)
+ {
+ preview_display_valid(xsane.preview);
+ }
}
/* ---------------------------------------------------------------------------------------------------------------------- */
--
1.8.1.4

View File

@ -1,32 +0,0 @@
From 938a34622a88064b3803a67967de143ba3c01e9f Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Fri, 2 Sep 2011 11:55:59 +0200
Subject: [PATCH] patch: xsane_update_param-crash
Squashed commit of the following:
commit 74add0ef72c6c510220679751e5770eaff8710fd
Author: Nils Philippsen <nils@redhat.com>
Date: Mon Apr 4 11:13:20 2011 +0200
don't dereference xsane.preview if it is NULL
---
src/xsane-front-gtk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/xsane-front-gtk.c b/src/xsane-front-gtk.c
index 08761a0..66a3177 100644
--- a/src/xsane-front-gtk.c
+++ b/src/xsane-front-gtk.c
@@ -1713,7 +1713,7 @@ void xsane_update_param(void *arg)
gtk_label_set(GTK_LABEL(xsane.info_label), buf);
- if (xsane.preview->surface_unit == SANE_UNIT_MM)
+ if (xsane.preview && xsane.preview->surface_unit == SANE_UNIT_MM)
{
double dx, dy;
--
1.7.11.4

View File

@ -39,28 +39,30 @@ Patch4: xsane-0.997-no-file-selected.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=198422
# submitted to upstream (Oliver Rauch) via email, 2010-06-29
Patch5: xsane-0.997-ipv6.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=693224
# submitted to upstream (Oliver Rauch) via email, 2011-04-04
Patch6: xsane-0.998-xsane_update_param-crash.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=624190
# fix from: https://bugs.launchpad.net/ubuntu/+source/xsane/+bug/370818
# submitted to upstream (Oliver Rauch) via email, 2011-06-01
Patch7: xsane-0.998-preview-selection.patch
Patch6: xsane-0.998-preview-selection.patch
# build with libpng-1.5
# submitted to upstream (Oliver Rauch) via email, 2011-11-21
Patch8: xsane-0.998-libpng.patch
Patch7: xsane-0.998-libpng.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=795085
# distro-specific: set program name/wmclass so GNOME shell picks appropriate
# high resolution icon file
Patch9: xsane-0.998-wmclass.patch
Patch8: xsane-0.998-wmclass.patch
# calculate minimum window size better for multi-head setups
# submitted to upstream (Oliver Rauch) via email, 2012-09-03
Patch10: xsane-0.998-preview-window-size.patch
Patch9: xsane-0.998-preview-window-size.patch
# correct some typos in the man page, original patch by John Bradshaw
# submitted to upstream (Oliver Rauch) via email, 2012-09-03
Patch11: xsane-0.998-man.patch
Patch10: xsane-0.998-man.patch
# distro-specific: customize desktop file
Patch12: xsane-0.998-desktop-file.patch
Patch11: xsane-0.998-desktop-file.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=693224
# https://bugzilla.redhat.com/show_bug.cgi?id=963696
# submitted to upstream (Oliver Rauch) via email, 2011-04-04 and (updated
# patch) 2013-05-17
Patch12: xsane-0.998-null-preview-crash.patch
# autoconf-generated files
Patch100: xsane-0.998-1-autoconf.patch.bz2
License: GPLv2+
@ -119,13 +121,13 @@ done
%patch3 -p1 -b .off-root-build
%patch4 -p1 -b .no-file-selected
%patch5 -p1 -b .ipv6
%patch6 -p1 -b .xsane_update_param-crash
%patch7 -p1 -b .preview-selection.patch
%patch8 -p1 -b .libpng
%patch9 -p1 -b .wmclass
%patch10 -p1 -b .preview-window-size
%patch11 -p1 -b .man
%patch12 -p1 -b .desktop-file
%patch6 -p1 -b .preview-selection.patch
%patch7 -p1 -b .libpng
%patch8 -p1 -b .wmclass
%patch9 -p1 -b .preview-window-size
%patch10 -p1 -b .man
%patch11 -p1 -b .desktop-file
%patch12 -p1 -b .null-preview-crash
%patch100 -p1 -b .autoconf
@ -231,6 +233,7 @@ fi
%changelog
* Fri May 17 2013 Nils Philippsen <nils@redhat.com>
- don't dereference NULL preview objects when quitting (#963696)
- fix vendor tag logic in a prettier way
* Tue May 14 2013 Jon Ciesla <limburgher@gmail.com> - 0.998-20