X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Fdvi%2Fmdvi-lib%2Fpk.c;h=a91161348fe803d175e22820deacafb076884ac2;hb=1d6c41200f621a43e92deda5b5d682413572d2a2;hp=98ef26b503c20a2241634f60b53aa876bc0d62e9;hpb=14def5e0c1c11cee1523e10c72df74f4cf5e451d;p=evince.git diff --git a/backend/dvi/mdvi-lib/pk.c b/backend/dvi/mdvi-lib/pk.c index 98ef26b5..a9116134 100644 --- a/backend/dvi/mdvi-lib/pk.c +++ b/backend/dvi/mdvi-lib/pk.c @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* @@ -328,13 +328,14 @@ static int pk_load_font(DviParams *unused, DviFont *font) { int i; int flag_byte; - int loc, hic, maxch; + int hic, maxch; Int32 checksum; FILE *p; #ifndef NODEBUG char s[256]; #endif long alpha, beta, z; + unsigned int loc; font->chars = xnalloc(DviFontChar, 256); p = font->in; @@ -469,6 +470,15 @@ static int pk_load_font(DviParams *unused, DviFont *font) } if(feof(p)) break; + + /* Although the PK format support bigger char codes, + * XeTeX and other extended TeX engines support charcodes up to + * 65536, while normal TeX engine supports only charcode up to 255.*/ + if (cc < 0 || cc > 65536) { + mdvi_error (_("%s: unexpected charcode (%d)\n"), + font->fontname,cc); + goto error; + } if(cc < loc) loc = cc; if(cc > hic)