Bug 25756

Summary: Failure to process stream due to 'Length' absence
Product: poppler Reporter: Ilya Gorenbein <igorenbein>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch
test file
Updated patch

Description Ilya Gorenbein 2009-12-22 02:43:43 UTC
Hello,

I use poppler-0.12.0. Recently, I've got the files without 'Length' attribute at stream dictionary. This caused poppler to fail in stream processing. File poppler/Parser.cc Line 182. Acrobat Reader process the file successfully.
On the other hand, poppler already have a code for processing such cases (a few lines bellow). I attached a patch that causes the code to continue processing, instead of failure.

Regards,
Ilya
Comment 1 Ilya Gorenbein 2009-12-22 02:44:16 UTC
Created attachment 32242 [details] [review]
Patch
Comment 2 Ilya Gorenbein 2009-12-22 02:56:08 UTC
Created attachment 32243 [details]
test file
Comment 3 Albert Astals Cid 2009-12-22 14:04:37 UTC
That's a bit invasive, i'll have to run my test regression suite to see if it regresses somewhere, but that'll have to wait a few days.
Comment 4 Albert Astals Cid 2009-12-24 10:53:24 UTC
On a second look this seems quite dangerous as there is no guarantee length will ever be assigned later on, maybe adding a length = 0; in place of the return NULL;?
Comment 5 Ilya Gorenbein 2009-12-26 10:03:49 UTC
You are definitely correct, I will update the patch.
Comment 6 Ilya Gorenbein 2009-12-27 00:11:03 UTC
Created attachment 32312 [details] [review]
Updated patch

The 'length' was initialized to 0.
Comment 7 Albert Astals Cid 2009-12-27 06:29:27 UTC
I've commited the patch to git master branch

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.