/[packages]/cauldron/ghostscript/current/SOURCES/ghostscript-pdfwrite-segfault.patch
ViewVC logotype

Contents of /cauldron/ghostscript/current/SOURCES/ghostscript-pdfwrite-segfault.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 444126 - (show annotations) (download)
Mon Jun 17 16:17:15 2013 UTC (8 years, 3 months ago) by blino
File size: 2206 byte(s)
sync patches with Fedora:
- locale fix (rh #961149)
- fix pdfwrite segfault (rh #962120)

1 diff -up ghostscript-9.06/base/gdevpdtd.c.pdfwrite-segfault ghostscript-9.06/base/gdevpdtd.c
2 --- ghostscript-9.06/base/gdevpdtd.c.pdfwrite-segfault 2012-08-08 09:01:36.000000000 +0100
3 +++ ghostscript-9.06/base/gdevpdtd.c 2013-05-16 09:28:07.410407852 +0100
4 @@ -699,7 +699,7 @@ pdf_write_FontDescriptor(gx_device_pdf *
5 if (code < 0)
6 return code;
7 }
8 - if (pfd->embed) {
9 + if (pfd->embed && pfd->base_font->FontFile) {
10 code = pdf_write_FontFile_entry(pdev, pfd->base_font);
11 if (code < 0)
12 return code;
13 diff -up ghostscript-9.06/base/gxtype1.c.pdfwrite-segfault ghostscript-9.06/base/gxtype1.c
14 --- ghostscript-9.06/base/gxtype1.c.pdfwrite-segfault 2012-08-08 09:01:36.000000000 +0100
15 +++ ghostscript-9.06/base/gxtype1.c 2013-05-16 09:28:07.409407814 +0100
16 @@ -371,7 +371,7 @@ gs_type1_piece_codes(/*const*/ gs_font_t
17 const byte *cip, *end;
18 crypt_state state;
19 int c, hhints = 0, vhints = 0;
20 - int code;
21 + int code, call_depth = 0;
22
23 CLEAR_CSTACK(cstack, csp);
24 cip = pgd->bits.data;
25 @@ -450,6 +450,7 @@ gs_type1_piece_codes(/*const*/ gs_font_t
26 }
27 break;
28 case c2_callgsubr:
29 + call_depth++;
30 c = fixed2int_var(*csp) + pdata->gsubrNumberBias;
31 code = pdata->procs.subr_data
32 (pfont, c, true, &ipsp[1].cs_data);
33 @@ -462,6 +463,7 @@ gs_type1_piece_codes(/*const*/ gs_font_t
34 end = ipsp->cs_data.bits.data + ipsp->cs_data.bits.size;
35 goto call;
36 case c_callsubr:
37 + call_depth++;
38 c = fixed2int_var(*csp) + pdata->subroutineNumberBias;
39 code = pdata->procs.subr_data
40 (pfont, c, false, &ipsp[1].cs_data);
41 @@ -474,6 +476,10 @@ gs_type1_piece_codes(/*const*/ gs_font_t
42 end = ipsp->cs_data.bits.data + ipsp->cs_data.bits.size;
43 goto call;
44 case c_return:
45 + if (call_depth == 0)
46 + return (gs_note_error(gs_error_invalidfont));
47 + else
48 + call_depth--;
49 gs_glyph_data_free(&ipsp->cs_data, "gs_type1_piece_codes");
50 --ipsp;
51 if (ipsp < ipstack)

  ViewVC Help
Powered by ViewVC 1.1.28