Created attachment 66702 [details] the PDF that fire the bug. When open the attached PDF document, tricky.pdf, I got the following message, "Error (1495): Too many input symbols in JBIG2 symbol dictionary" "Error (1495): Unexpected EOF in JBIG2 stream" I tried it in mupdf/Adobe Reader, both work fine. I think it is a bug of Poppler
As far as I can see the problem was introduced by commit ed0c9640abcbea459e3a276ee0b27631b01c32c4 (from 8th of April). Instead of bitmaps = (JBIG2Bitmap **)gmallocn_checkoverflow(numInputSyms + numNewSyms, sizeof(JBIG2Bitmap *)); if (!bitmaps) { it should be bitmaps = (JBIG2Bitmap **)gmallocn_checkoverflow(numInputSyms + numNewSyms, sizeof(JBIG2Bitmap *)); if (!bitmaps && numInputSyms + numNewSyms > 0) { (In tricky pdf numInputSyms and numNewSyms are both 0). Can You repair that, Albert? I'm quite close finishing the Coldwind stuff (probably closing it this weekend), but I can handle this afterwards...
sure, i'll get this
Unfortunately this only removes the warning output, the file is still not totally renderer correctly
This is not critical
(In reply to comment #3) > Unfortunately this only removes the warning output, the file is still not > totally renderer correctly yes, I tried 0.20.4, no error, but the output does not correct.
Created attachment 122419 [details] [review] SDNUMEXSYMS is allowed to be 0! This patch fixes it
The patch now doesn't break reading of the JBIG2 bitmap, and the PDF is rendered correct, but we get error messages again: ./utils/pdftoppm -png -cropbox 54579.open/tricky.pdf output/tricky Syntax Error (1498): 1 extraneous byte after segment Syntax Error (1536): 1 extraneous byte after segment This happens when a segment with SDNUMEXSYMS = 0 was read (happens two times!). I digged into the spec, but I can't find out why there is exact one extraneous byte here or if there is something missing to read by the method. I looked into other JBIG2 decoders like jbic2dec, but these decoders don't complain about extraneous byte(s), they just skip to the next sgement. So we probably can just skip silently, too, but that I let up to You Albert ;-)
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/65.
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.