X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Fdvi%2Fmdvi-lib%2Fvf.c;h=a5ae3bbe721a162c7f486eddca85c08fccac2893;hb=33d9b680db507280f1d8fbb31c01d31de6531046;hp=640077ad58517c7e81dabdf4896aa1fabba7a898;hpb=1af6600934d1f723e5b492b8322e52a1144fb0af;p=evince.git diff --git a/backend/dvi/mdvi-lib/vf.c b/backend/dvi/mdvi-lib/vf.c index 640077ad..a5ae3bbe 100644 --- a/backend/dvi/mdvi-lib/vf.c +++ b/backend/dvi/mdvi-lib/vf.c @@ -14,7 +14,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. */ #include @@ -79,8 +79,8 @@ static int vf_load_font(DviParams *params, DviFont *font) fseek(p, (long)mlen, SEEK_CUR); checksum = fuget4(p); if(checksum && font->checksum && checksum != font->checksum) { - warning(_("%s: Checksum mismatch (expected %u, got %u)\n"), - font->fontname, font->checksum, checksum); + mdvi_warning(_("%s: Checksum mismatch (expected %u, got %u)\n"), + font->fontname, font->checksum, checksum); } else if(!font->checksum) font->checksum = checksum; font->design = fuget4(p); @@ -127,8 +127,8 @@ static int vf_load_font(DviParams *params, DviFont *font) /* get the font */ ref = font_reference(params, id, name, checksum, hdpi, vdpi, scale); if(ref == NULL) { - error(_("(vf) %s: could not load font `%s'\n"), - font->fontname, name); + mdvi_error(_("(vf) %s: could not load font `%s'\n"), + font->fontname, name); goto error; } mdvi_free(name); @@ -165,6 +165,12 @@ static int vf_load_font(DviParams *params, DviFont *font) cc = fuget1(p); tfm = fuget3(p); } + if (cc < 0 || cc > 65536) { + /* TeX engines do not support char codes bigger than 65535 */ + mdvi_error(_("(vf) %s: unexpected character %d\n"), + font->fontname, cc); + goto error; + } if(loc < 0 || cc < loc) loc = cc; if(hic < 0 || cc > hic) @@ -177,8 +183,8 @@ static int vf_load_font(DviParams *params, DviFont *font) nchars = cc + 16; } if(font->chars[cc].offset) { - error(_("(vf) %s: character %d redefined\n"), - font->fontname, cc); + mdvi_error(_("(vf) %s: character %d redefined\n"), + font->fontname, cc); goto error; } @@ -200,7 +206,7 @@ static int vf_load_font(DviParams *params, DviFont *font) op = fuget1(p); } if(op != 248) { - error(_("(vf) %s: no postamble\n"), font->fontname); + mdvi_error(_("(vf) %s: no postamble\n"), font->fontname); goto error; } @@ -226,7 +232,7 @@ static int vf_load_font(DviParams *params, DviFont *font) return 0; badvf: - error(_("%s: File corrupted, or not a VF file.\n"), font->fontname); + mdvi_error(_("%s: File corrupted, or not a VF file.\n"), font->fontname); error: if(font->chars) mdvi_free(font->chars);