Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5124

Improperly declared OS2WindowsMetricsTable version (v0 table declard as v3) in embedded font stops parsing with EOFException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.22
    • 2.0.23, 3.0.0 PDFBox
    • FontBox
    • None

    Description

      The attached document contains an incorrectly versioned OS2WindowsMetricsTable. It's a version 0 table, but claims to be version 3. Due to this, when we try to parse the new fields introduced in newer versions, we hit an EOFException.

      Since this issue does occur in the wild, PDFBox should tolerate it, e.g. by catching the EOFException and resetting the "version" variable to the highest version that doesn't have the missing fields. (Note that the version constants PDFBox checks against are wrong, but that's PDFBOX-5123.)

      Attachments

        1. PDFBOX-5124.pdf-1-new.png
          63 kB
          Tilman Hausherr
        2. PDFBOX-5124.pdf-1-old.png
          63 kB
          Tilman Hausherr
        3. PDFBOX-5124-new.txt
          1 kB
          Tilman Hausherr
        4. PDFBOX-5124-old.txt
          1 kB
          Tilman Hausherr
        5. SZAMLA-20190417-20190012706-ININET-BroadBitHungary-11646-HUF.pdf
          29 kB
          Gábor Stefanik

        Activity

          People

            tilman Tilman Hausherr
            Googulator Gábor Stefanik
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: