Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix #659 (gzuncompress(): data error) #690

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/PHPUnit/Integration/RawData/FilterHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,29 @@ public function testDecodeFilterFlateDecodeCRC32Checksum(): void
self::assertStringContainsString('Two Westbrook Corporate Center Suite 500', $document->getText());
}

/**
* Check if function runs into a "gzuncompress(): data error".
*
* @see https://github.com/smalot/pdfparser/issues/659
*/
public function testDecodeFilterFlateDecodeGzUncompressDataErrorIssue659(): void
{
$data = '�s��8�S4z�2A�ٮ�������n�O��)q,�ӕ�ik�7l�B:��<Lgz?��C�/�UL�"XZ�@���ui~-�����٥~�&K��"&8_�E����A�f

***@***.***�Kj��s����!3�Q�<�������#

ŀ>�����3�|�L';

$subjectUnderTest = new FilterHelper();

// ,--- currently throws exception: decodeFilterFlateDecode: invalid data
// ,
// ,
$subjectUnderTest->decodeFilter('FlateDecode', $data, 1000000);

// we expect an error with "gzuncompress(): data error" here
}

/**
* How does function behave if an unknown filter name was given.
*/
Expand Down
Loading