Skip Menu |

This queue is for tickets about the CAM-PDF CPAN distribution.

Report information
The Basics
Id: 98231
Status: new
Priority: 0/
Queue: CAM-PDF

People
Owner: Nobody in particular
Requestors: MSmoot [...] ejcaimen.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: occasional issues within PDF.pm (version 1.58)
Date: Thu, 21 Aug 2014 15:23:28 +0000
To: "bug-CAM-PDF [...] rt.cpan.org" <bug-CAM-PDF [...] rt.cpan.org>
From: Martin Smoot <MSmoot [...] ejcaimen.com>
first I cannot attach any of the PDFs where these problems occurred - proprietary data and similar issues. it has been a while since I discovered and put in some fixes to the code (1.58) to correct various script errors so I am including a set of differences between my modified 1.58 code and 1.60 code (unmodified). these problems were discovered when I was attempting to use the code as a pure Perl replacement for the pdfinfo program found on Linux, Cygwin and also under Windows. the pdfinfo program did not have any problem with the files but some of the files had problems when using the PDF.pm code. for most cases I continue to use the pdfinfo program primarily because I normally do not need any of the extra information that PDF.pm provides and because PDF.pm seems to be slower and uses a lot of memory (a problem when running Cygwin 32 bit with the big files we typically have). the differences (< = 1.58 > = 1.60): in this case the substr was "out of range" or some similar message: 664,670c657 < my @byte; < my $strlen=length $stream; < if(($i * $entry_size) <= $strlen) < { < @byte = unpack 'C*', substr $stream, $i * $entry_size, $entry_size; < } < $i++; --- Show quoted text
> my @byte = unpack 'C*', substr $stream, $i++ * $entry_size, $entry_size;
in this case the byte at $pos was not defined. I assumed that if it was not defined then there was no need to do the shift - maybe I needed to do the shift anyway but do not know: 680c667 < $val = ($val << 8) + $byte[$pos] if defined $byte[$pos]; --- Show quoted text
> $val = ($val << 8) + $byte[$pos];
I was getting a crash when a non version 1.5 file somehow called this area of the code - I added the comment but do not recall if I made a change. 723,725d709 < # < # the non 1.5 PDF files call this and crash when called.... < # I also changed almost every die to include the line number since some of the messages seemed to be in several places so it was hard to tell where it was really getting the error. Show quoted text
________________________________ This message is private and confidential. If you have received this message in error, please notify us by replying to this email and then delete it from your system. Thank you for your cooperation. EJ Caimen, Inc.