View | Details | Raw Unified | Return to bug 8632
Collapse All | Expand All

(-)poppler-0.3.3/fofi/FoFiTrueType.cc (+21 lines)
Lines 1343-1348 Link Here
1343
    return;
1343
    return;
1344
  }
1344
  }
1345
1345
1346
  // make sure the loca table is sane (correct length and entries are
1347
  // in bounds)
1348
  i = seekTable("loca");
1349
  if (tables[i].len < (nGlyphs + 1) * (locaFmt ? 4 : 2)) {
1350
    parsedOk = gFalse;
1351
    return;
1352
  }
1353
  for (j = 0; j <= nGlyphs; ++j) {
1354
    if (locaFmt) {
1355
      pos = (int)getU32BE(tables[i].offset + j*4, &parsedOk);
1356
    } else {
1357
      pos = getU16BE(tables[i].offset + j*2, &parsedOk);
1358
    }
1359
    if (pos < 0 || pos > len) {
1360
      parsedOk = gFalse;
1361
    }
1362
  }
1363
  if (!parsedOk) {
1364
    return;
1365
  }
1366
1346
  // read the post table
1367
  // read the post table
1347
  readPostTable();
1368
  readPostTable();
1348
  if (!parsedOk) {
1369
  if (!parsedOk) {
(-)poppler-0.3.3/poppler/SplashOutputDev.cc (-5 / +8 lines)
Lines 623-638 Link Here
623
      }
623
      }
624
      break;
624
      break;
625
    case fontTrueType:
625
    case fontTrueType:
626
      if (!(ff = FoFiTrueType::load(fileName->getCString()))) {
626
      if ((ff = FoFiTrueType::load(fileName->getCString()))) {
627
	goto err2;
627
	codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
628
	n = 256;
629
	delete ff;
630
      } else {
631
	codeToGID = NULL;
632
	n = 0;
628
      }
633
      }
629
      codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
630
      delete ff;
631
      if (!(fontFile = fontEngine->loadTrueTypeFont(
634
      if (!(fontFile = fontEngine->loadTrueTypeFont(
632
			   id,
635
			   id,
633
			   fileName->getCString(),
636
			   fileName->getCString(),
634
			   fileName == tmpFileName,
637
			   fileName == tmpFileName,
635
			   codeToGID, 256))) {
638
			   codeToGID, n))) {
636
	error(-1, "Couldn't create a font for '%s'",
639
	error(-1, "Couldn't create a font for '%s'",
637
	      gfxFont->getName() ? gfxFont->getName()->getCString()
640
	      gfxFont->getName() ? gfxFont->getName()->getCString()
638
	                         : "(unnamed)");
641
	                         : "(unnamed)");

Return to bug 8632