Comment 9 for bug 436197

Revision history for this message
In , Dsheil (dsheil) wrote :

I have been looking at this bug. I wrote a little about it here - http://www.vartmp.com/blog/subjects/poppler/20091219.html

The segmentation fault happens when the TextWord constructor is called. Specifically, when the constructor is called from the beginWord method. The reason the segmentation fault happens is because the curFont object has not been created prior to this, despite it being one of the parameters sent to the TextWord constructor.

On the basis of seeing this, I did a four-line hack in the beginWord method that checks for the existence of curFont, and if it does not exist, creates it and then calls "fonts->append(curFont)". After this, evince stopped crashing on the pages of the PDFs that it has been crashing (segfaulting) on.

However, I have not really looked into this indepth, what I did was just a hack. I am looking through the code of evince and poppler right now, and recreating the segfaults. It is possible that there is a better way to solve this, perhaps creating the curFont object in a different method, or who knows. If I come up with something better I'll give you an update. Or if one of you see something better that's good too.