[Gambas-user] segfault on PDF

richard terry rterry at ...1946...
Thu Mar 5 22:06:26 CET 2009


On Fri, 6 Mar 2009 12:17:10 am Benoît Minisini wrote:
> > Currently the gambas PDF viewer segfaults when loading this PDF.
> > The PDF probably has a corrupted index, but I think gambas could deal
> > with more gracefully (by not displaying the index, but still the pages of
> > the PDF) which is what other poppler-based tools can do.
> >
> > This patch (to both the pdf component and the example viewer) fixes the
> > issue.
> >
> > Ian Haywood
>
> Thanks for the patch.
>
> I didn't use them, because actually the problem is only in PdfDocument.cpp,
> which did not check that the getDest() method could return NULL.
>
> I modified PdfDocument.cpp to check the return value of getDest()
> everywhere.
>
> To fix the PdfViewer example error, I modified The PdfDocument.HasIndex
> property, the PdfIndex.HasChildren property and the PdfIndex.MoveChild()
> method to take into account that having an index with zero elements is the
> same thing as having no index.
>
> The fix is in revision #1899 (Gambas 2) and #1900 (Gambas 3)
>
> Best regards,

Thanks Ian/Benoit, I've compiled 1900 and indeed the patch works as promised 
and I can view my warfarin pdf in my Library tree.

Richard





More information about the User mailing list