<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - PDF hint table fails to load if PDFDoc is opened with stream start offset != 0"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=95061">95061</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>PDF hint table fails to load if PDFDoc is opened with stream start offset != 0
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>seksfemfire@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=123139" name="attach_123139" title="Respect parent stream start offset when creating substream">attachment 123139</a> <a href="attachment.cgi?id=123139&action=edit" title="Respect parent stream start offset when creating substream">[details]</a></span>
Respect parent stream start offset when creating substream

The problem is that hints.cc create a substream from the original stream given
to the PDFDoc class. The substream does not include the stream start offset in
the original stream.

To reproduce:
1. Create stream with startA != 0
2. Create PDFDoc with stream as output.
3. If PDF has hints tables it will output warnings:

Syntax Warning: Failed parsing hints table object
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
Syntax Warning: Failed to get object num from hint tables for page 1
Syntax Warning: Failed parsing page 1 using hint tables
Syntax Warning: Failed to get object num from hint tables for page 1

The attached patch fixes the issue.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>