[gl2ps] FYI - PDF Crash

Christophe Geuzaine geuzaine at acm.caltech.edu
Thu Jun 23 09:18:16 CEST 2005


Paul Lore wrote:
> Hi,
> 
> I'm saving a PDF file and the buffer overflows which results in a
> crash (the application completely disappears).  I've traced it to this
> section of code:
> 
> GL2PSDLL_API GLint gl2psEndPage(void)
> {
> (...)
>   res = gl2psPrintPrimitives();
> (res returns GL2PS_OVERFLOW and returns before gl2psPrintPDFHeader()
> gets called)
> (...)
>   case GL2PS_PDF :
>     gl2psPrintPDFFooter();
> (crash)
> 
> gl2psPrintPDFFooter() gets called and tries to access memory for
> gl2ps->xreflist even though it hasn't been allocated (by
> gl2psPrintPDFHeader()).
> 
> Btw, I'm saving using this idea: 
> while( state == GL2PS_OVERFLOW ){ 
>   buffsize += 1024*1024;
> 
> Just thought you'd be interested to know.  
> 

Hi Paul - I just checked, and the problem comes from the "tight bounding 
box" stuff I introduced in 1.2.5.

I've released 1.2.6 with a fix.

Thanks for the bug report!

Christophe

-- 
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org