[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#321603: libgutenprint2: segfault for R800/R1800 and matte paper



Package: libgutenprint2
Version: 4.3.99+cvs20050801-1
Severity: normal
Tags: patch

There appears to be no adjustment settings for r800 inksets and some
types of matte paper.  This causes adjust_print_quality() function to
segfault, as there is no code in this part of the function to handle
missing adjustments.

To see this, in GIMP print dialog, set printer model to "EPSON Stylus
Photo R1800", ink set to "Matte Black", and media type "Archival Matte
Paper".  Gimp-print segfaults in libgutenprint2 after pressing the
"Print" button.  With the "Photo Black" inkset, all three sorts of matte
paper (Matte, Archival Matte, and Matte Heavyweight) segfault.

If recompile gutenprint with DEB_BUILD_OPTIONS="debug nostrip" and -O0,
can see the following in gdb:

Program received signal SIGSEGV, Segmentation fault.
0xb739e1c4 in adjust_print_quality (v=0x82c7c20, image=0x804c420)
    at ../../../../src/main/print-escp2.c:2142
2142      if (!stp_check_curve_parameter(v, "HueMap", STP_PARAMETER_ACTIVE) &&
(gdb) bt
#0  0xb739e1c4 in adjust_print_quality (v=0x82c7c20, image=0x804c420)
    at ../../../../src/main/print-escp2.c:2142
#1  0xb73a1608 in escp2_print_page (v=0x82c7c20, image=0x804c420)
    at ../../../../src/main/print-escp2.c:2919
#2  0xb73a19a3 in escp2_do_print (v=0x82c7c20, image=0x804c420, print_op=7)
    at ../../../../src/main/print-escp2.c:2989
#3  0xb73a1a8a in escp2_print (v=0x8301100, image=0x804c420)
    at ../../../../src/main/print-escp2.c:3009
#4  0xb7d76815 in stp_print (v=0x8301100, image=0x804c420) at ../../../../src/main/printers.c:403
#5  0xb7da1ca4 in stpui_print (printer=0x804c680, image=0x804c420)
    at ../../../../src/gutenprintui2/plist.c:1711
#6  0x0804a87f in run (name=0x8054430 "file_print_gimp", nparams=3, param=0x8054448,
    nreturn_vals=0xbfb1eb18, return_vals=0xbfb1eb1c) at ../../../../src/gimp2/print.c:403
#7  0xb7dd7743 in gimp_attach_new_parasite () from /usr/lib/libgimp-2.0.so.0
#8  0xb7dd7518 in gimp_attach_new_parasite () from /usr/lib/libgimp-2.0.so.0
#9  0xb7dd6321 in gimp_main () from /usr/lib/libgimp-2.0.so.0
#10 0x0804a097 in main (argc=6, argv=0xbfb1ecc4) at ../../../../src/gimp2/print.c:81
(gdb) print pt
$1 = (const paper_adjustment_t *) 0x0

Error occurs when dereferencing the null pointer pt which is expected to
contain adjustments for matte paper and the r800/r1800 inkset.

Attached is a patch which supplies matte paper adjustments copied from
similar inksets/papers, and at least doesn't segfault for any other
missing inkset/paper adjustments.  I'd be really wary of applying it
directly, though, as these aren't tuned values for the adjustments.  But
matte papers do seem to work with the R800/R1800, so some it would be
nice to have good adjustments.

Also, I haven't checked if any other inksets have missing adjustments
for available papers.  Assuming there are, it might be better to print
an error/warning rather than blithely using no adjustment???

This seems to correspond to bug 1243762 in sourceforge, which provides
a slightly different patch...

Patch follows:

diff -ru gutenprint-4.3.99+cvs20050801.orig/src/main/escp2-papers.c gutenprint-4.3.99+cvs20050801/src/main/escp2-papers.c
--- gutenprint-4.3.99+cvs20050801.orig/src/main/escp2-papers.c	2005-07-14 20:03:48.000000000 -0400
+++ gutenprint-4.3.99+cvs20050801/src/main/escp2-papers.c	2005-08-05 21:30:13.000000000 -0400
@@ -786,6 +786,10 @@
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
   { "BackFilm", 0.83, .75, 1, .02, 0.3, .882, 1, .300, 1, 1, 1.0,
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
+  { "Matte", 0.92, .4, 1, .02, 0.3, .882, 1, .300, 1, 1, 1.0,
+    r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
+  { "MatteHeavy", 0.92, .4, 1, .02, 0.3, .882, 1, .300, 1, 1, 1.0,
+    r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
   { "Glossy", 0.92, 0.4, 1, .02, 0.3, .882, 1, .300, 1, 1, 1.0,
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
   { "GlossyHeavy", 0.92, 0.4, 1, .02, 0.3, .882, 1, .300, 1, 1, 1.0,
@@ -804,6 +808,8 @@
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
   { "ArchivalGlossy", 0.92, .4, 1, .02, 0.3, .882, 1, .300, 1, 1, 1.0,
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
+  { "ArchivalMatte", 0.92, .4, 1, .02, 0.3, .882, 1, .300, 1, 1, 1.0,
+    r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
   { "WaterColorRadiant", 0.92, .4, 1, .02, 0.3, .882, 1, .300, 1, 1, 1.0,
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
   { "GlossyPaper", 0.83, 1.0, 1, .02, 0.3, .882, 1, .300, 1, 1, 1.0,
@@ -850,6 +856,8 @@
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
   { "Luster", 0.72, .8, .5, .025, .5, .882, 1, .300, .6, 1, 0.92,
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
+  { "ArchivalMatte", 0.92, 0.4, .5, .025, .5, .882, 1, .300, .6, 1, 1.0,
+    r800_matte_hue_adj, r800_matte_lum_adj, r800_matte_sat_adj },
   { "WaterColorRadiant", 0.92, 0.4, .5, .025, .5, .882, 1, .300, .6, 1, 1.0,
     r800_matte_hue_adj, r800_matte_lum_adj, r800_matte_sat_adj },
   { "GlossyPaper", 0.83, 0.5, .5, .025, .5, .882, 1, .300, .6, 1, 1.0,
diff -ru gutenprint-4.3.99+cvs20050801.orig/src/main/print-escp2.c gutenprint-4.3.99+cvs20050801/src/main/print-escp2.c
--- gutenprint-4.3.99+cvs20050801.orig/src/main/print-escp2.c	2005-07-14 20:03:49.000000000 -0400
+++ gutenprint-4.3.99+cvs20050801/src/main/print-escp2.c	2005-08-05 21:03:00.000000000 -0400
@@ -2140,7 +2140,7 @@
 
 
   if (!stp_check_curve_parameter(v, "HueMap", STP_PARAMETER_ACTIVE) &&
-      pt->hue_adjustment)
+      pt && pt->hue_adjustment)
     {
       adjustment = stp_curve_create_from_string(pt->hue_adjustment);
       stp_set_curve_parameter(v, "HueMap", adjustment);
@@ -2148,7 +2148,7 @@
       stp_curve_destroy(adjustment);
     }
   if (!stp_check_curve_parameter(v, "SatMap", STP_PARAMETER_ACTIVE) &&
-      pt->sat_adjustment)
+      pt && pt->sat_adjustment)
     {
       adjustment = stp_curve_create_from_string(pt->sat_adjustment);
       stp_set_curve_parameter(v, "SatMap", adjustment);
@@ -2156,7 +2156,7 @@
       stp_curve_destroy(adjustment);
     }
   if (!stp_check_curve_parameter(v, "LumMap", STP_PARAMETER_ACTIVE) &&
-      pt->lum_adjustment)
+      pt && pt->lum_adjustment)
     {
       adjustment = stp_curve_create_from_string(pt->lum_adjustment);
       stp_set_curve_parameter(v, "LumMap", adjustment);


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (101, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages libgutenprint2 depends on:
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an

libgutenprint2 recommends no packages.

-- no debconf information



Reply to: