Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / print / evince / patches / patch-bc
blob0ccad036998feb89246332a39f8f0079e9da58d0
1 $NetBSD$
3 --- backend/dvi/mdvi-lib/pk.c.orig      2010-07-14 07:54:39.000000000 +0000
4 +++ backend/dvi/mdvi-lib/pk.c
5 @@ -469,6 +469,15 @@ static int pk_load_font(DviParams *unuse
6                         }
7                         if(feof(p))
8                                 break;
10 +                       /* Although the PK format support bigger char codes,
11 +                         * XeTeX and other extended TeX engines support charcodes up to
12 +                         * 65536, while normal TeX engine supports only charcode up to 255.*/
13 +                       if (cc < 0 || cc > 65536) {
14 +                               mdvi_error (_("%s: unexpected charcode (%d)\n"),
15 +                                           font->fontname,cc);
16 +                               goto error;
17 +                       } 
18                         if(cc < loc)
19                                 loc = cc;
20                         if(cc > hic)
21 @@ -512,7 +521,7 @@ static int pk_load_font(DviParams *unuse
22         }
24         /* resize font char data */
25 -       if(loc > 0 || hic < maxch-1) {
26 +       if(loc > 0 && hic < maxch-1) {
27                 memmove(font->chars, font->chars + loc, 
28                         (hic - loc + 1) * sizeof(DviFontChar));
29                 font->chars = xresize(font->chars,