Skip to content

Commit 1e106ba

Browse files
committed
Added test to reproduce issue 235
1 parent 555d095 commit 1e106ba

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/functional/PdfParser/CrossReference/FixedReaderTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,21 @@ public function testGetOffset($table, $expectedOffsets)
204204
}
205205
}
206206

207+
public function testGetOffsetWhileStreamWasReset()
208+
{
209+
$table = "0 2\n" .
210+
"0000000000 65535 f \n" .
211+
"0000001000 00000 n \n" .
212+
"trailer<</Size 2>>";
213+
214+
$reader = StreamReader::createByString($table);
215+
$xref = new FixedReader(new PdfParser($reader));
216+
$stream = $reader->getStream();
217+
\ftruncate($stream, 40);
218+
219+
$this->assertFalse($xref->getOffsetFor(1));
220+
}
221+
207222
/**
208223
* @throws CrossReferenceException
209224
*/

0 commit comments

Comments
 (0)