Subject: | PDF::API2::Basic::PDF::Pages::find_prop never returns undef |
Hi all,
It seems that PDF::API2::Basic::PDF::Pages::find_prop method returns undef only if $self->{$prop} is explicitely set undefined. But, as can be seen from the rest of the library code (ex. PDF::API2::importpage), it is supposed to return undef not only in this case, but (more importanly) if the specified property does not exist (look at constructs like for my $k qw(MediaBox Crop Box ...) {next unless defined $s_pdf->find_prop($k)}). This leads importpage/importPageIntoForm to attempt to dreference empty "pointer" in walk_obj which causes program to stop (apparently). A mere "rturn undef;" at the end of PDF::API2::Basic::PDF::Pages::find_prop() seems to be enough to solve the issue.
Tested at the following system:
ActivePerl 5.8.0 (MSWin32-x86-multi-thread), PDF::API 0.41 (but the find_prop method was not changed in 0.42-0.43, so the problem is still here)