[gl2ps] FYI - PDF Crash

Paul Lore paul.lore at gmail.com
Wed Jun 22 16:27:05 CEST 2005


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.  


    - Paul Loré