[Gambas-user] segfault on PDF

Benoît Minisini gambas at ...1...
Thu Mar 5 14:17:10 CET 2009


> 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,

-- 
Benoît





More information about the User mailing list