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

Bug#321603: [patch] segfault for R800/R1800 and matte paper



tags 321603 + upstream
thanks

The following patch, submitted to the Debian BTS by Dan Torop, fixes
several causes of segfaults in adjust_print_quality().  This does
additional checking to make sure a NULL pointer is not dereferenced,
and adds some missing paper types for the R800 to escp2-papers.c.

The full description of the problem may be seen here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=321603

I have re-done the patch so it applies to current CVS (it was done
against gutenprint-20050801 / 1.77), and I've also made the adjustment
you made in 1.78 to the new entries.  Is this OK to commit?


Thanks,
Roger


Index: src/main/escp2-papers.c
===================================================================
RCS file: /cvsroot/gimp-print/print/src/main/escp2-papers.c,v
retrieving revision 1.79
diff -u -r1.79 escp2-papers.c
--- src/main/escp2-papers.c	13 Aug 2005 20:29:29 -0000	1.79
+++ src/main/escp2-papers.c	14 Aug 2005 09:37:59 -0000
@@ -786,6 +786,10 @@
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
   { "BackFilm", 0.83, .75, 1, .02, 1.4, .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, 1.4, .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, 1.4, .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, 1.4, .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, 1.4, .882, 1, .300, 1, 1, 1.0,
@@ -806,6 +810,8 @@
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
   { "WaterColorRadiant", 0.92, .4, 1, .02, 1.4, .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, 1.4, .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, 1.4, .882, 1, .300, 1, 1, 1.0,
     r800_glossy_hue_adj, r800_glossy_lum_adj, r800_glossy_sat_adj },
   { "Ilford", 0.83, 1.0, 1, .02, 1.4, .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,
Index: src/main/print-escp2.c
===================================================================
RCS file: /cvsroot/gimp-print/print/src/main/print-escp2.c,v
retrieving revision 1.342
diff -u -r1.342 print-escp2.c
--- src/main/print-escp2.c	14 Aug 2005 01:27:44 -0000	1.342
+++ src/main/print-escp2.c	14 Aug 2005 09:38:02 -0000
@@ -2141,7 +2141,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);
@@ -2149,7 +2149,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);
@@ -2157,7 +2157,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);


-- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.



Reply to: