PDFBox
  1. PDFBox
  2. PDFBOX-1196

Object offsets should be of type long + PATCH

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.7.0
    • Component/s: Parsing
    • Labels:
      None

      Description

      Currently object offsets are stored as integer (32 bit). However the PDF specification does not limit a PDF document to 2GB. The only restriction is the XREF table which supports 10 digit values for object offsets. Thus we could have offsets >2GB (<10GB). The attached patch changes all locations (as far as I could find them) dealing with object offsets to long type.
      Since this is a rather small change which should not have greater performance/space impact I recommend to include it. Otherwise we would have to include checks that the parsed file is smaller then Integer.MAX_VALUE.

        Issue Links

          Activity

          Hide
          Timo Boehme added a comment -

          patch against current trunk (rev. 1220892) which changes object offsets to long type

          Show
          Timo Boehme added a comment - patch against current trunk (rev. 1220892) which changes object offsets to long type
          Hide
          Andreas Lehmkühler added a comment -

          I added the patch as proposed in revision 1227249.

          Thanks for the contribution!

          Show
          Andreas Lehmkühler added a comment - I added the patch as proposed in revision 1227249. Thanks for the contribution!
          Hide
          Andreas Lehmkühler added a comment -

          I applied similar changes to the affected preflight classes in revision 1227500

          Show
          Andreas Lehmkühler added a comment - I applied similar changes to the affected preflight classes in revision 1227500
          Hide
          Petras added a comment -

          Similar changes should also be applied to signature byte range, returned by PDSignature (see PDFBOX-1328).

          Show
          Petras added a comment - Similar changes should also be applied to signature byte range, returned by PDSignature (see PDFBOX-1328 ).

            People

            • Assignee:
              Andreas Lehmkühler
              Reporter:
              Timo Boehme
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development