Hi,

I can reproduce that "critical" message only when having built
the test after backing out the patch. A static analysis (done
"by hand") also shows that with the patch applied GetPageNode()
can't get called when there are no pages recorded in the pages
tree except when deleting pages from the pages tree, which isn't
done in helloworld-base14, only in PagesTreeTest. I don't have
libcppunit installed right now so can't test the latter but I
expect the message to not show up also when running that (it
doesn't test deleting from empty AFAICS).

So could you please recheck if you applied the patch before
building PoDoFo and the test (with the freshly-built PoDoFo)?
I have tested with all except PdfPagesTree and PdfPagesTreeCache
mocked out (with an old PoDoFo version) because of the security
policy for the (lent) computer I'm using, sorry if that isn't
enough. I haven't yet had time for PdfFontFlags due to this issue,
I'll work on that after this is solved (if you still want it soon).

I'm willing to amend the patch for this issue with the "critical"
message if it really isn't enough, please refrain from reverting
(to be frank, I was terrified you seemed to have considered that,
if I read your post right).

Also Nenad Novak had posted the message before in this discussion thread
that his issue (also with that message, but on Windows) is solved by my
patch (URL http://sourceforge.net/p/podofo/mailman/message/34529262/ in
case thread order was mangled) and apologised (in a post quoted by him). 


Best regards, mabri



----- Original Message -----
From: zyx <z...@litepdf.cz>
To: podofo-users@lists.sourceforge.net
CC: 
Sent: 20:19 Tuesday, 13 October 2015
Subject: Re: [Podofo-users] unreachable-code and robustness fixes       in      
PdfPagesTree::GetPageNode()

On Sun, 2015-10-04 at 15:53 +0000, Matthew Brincke wrote:
> You don't rely on outcome of a method call which has invalid
> parameters, do you?

    Hi,
maybe I'm missing something here, but I rather ask before committing
your patch:

If I apply it on top of revision 1686, then the example
helloworld-base14 still claims the critical about accessing page 0 when
there are 0 pages.

Reverting back to revision 1682 avoids the critical on the console, but
it might not be the right "fix". The resulting PDF files from the
example look the same.

That is, if the helloworld-base14 does anything wrong with pages (as
the warning suggests it does), then it should be fixed as well. Thus
I'd like to ask you to correct it, either by updating the previous
patch or by sending a new one. I'll left it up to you. Bonus points if
you find more similar issues in the podofo examples/code/....

Or correct me, if I'm wrong.

    Thanks and bye,
    zyx

-- 
http://www.litePDF.cz                                 i...@litepdf.cz




------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to