ICEpdf
  1. ICEpdf
  2. PDF-571

Linear traversal offsets are incorrect

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 6.0
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      ICEpdf 5.0.0 open source release

      Description

      When a PDF file is decoded using linear traversal, the offsets in the file are calculated during parsing rather than using offsets from the xref tables. There seem to be errors in the offset calculation causing parsing errors later on.

      The snippet below mimics a scenario where a file was decoded, soft references were cleared and the LazyObjectLoader subsequently attempts to reload an object. This results in an EmptyStackException due to the file offset being incorrect.

      {code}Document d = new Document();
      d.setFile( "USGS NJ_Jersey_City_20110609_TM_geo.pdf" );
      Page page = d.getPageTree().getPage( 0 );
      page.init();

      Library library = page.getLibrary();
      Reference reference = new Reference( 496, 0 );
      library.getObject( reference );
      Field lolField = library.getClass().getDeclaredField( "lazyObjectLoader" );
      lolField.setAccessible( true );
      LazyObjectLoader lol = ( LazyObjectLoader ) lolField.get( library );
      lol.loadObject( reference );{code}

        Activity

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Pepijn Van Eeckhoudt
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: