[Poppler-bugs] [Bug 15606] Reproducible segfault of Poppler when selecting text

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Apr 19 10:24:24 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=15606





--- Comment #1 from Robin Stocker <robin.stocker at gmx.ch>  2008-04-19 10:24:23 PST ---
Created an attachment (id=16045)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=16045)
Pass the right y to TextLine::visitSelection when x are the same

I had a look at the code with the debugger and the problem why the segfault
occurs is that in line 3778 of poppler/TextOutputDev.cc the TextWord *begin is
NULL.

The code which searches the begin word seems to be correct, but the selection
which was passed to TextLine::visitSelection doesn't actually "touch" a word in
the line, because its y is bigger than yMax of any of the words. So the problem
maybe lies somewhere in the calculation of the child_selections in the calling
functions. Here are the selection parameters in the various functions:

TextPage::visitSelection: {x1 = 155.8125, y1 = 610.875, x2 = 155.8125, y2 =
616.5}
TextBlock::visitSelection: {x1 = 155.8125, y1 = 610.875, x2 = 155.8125, y2 =
616.5}
TextLine::visitSelection: {x1 = 155.8125, y1 = 616.5, x2 = 612, y2 = 792}

The two x are the same, but somehow the bigger y is passed to
TextLine::visitSelection. The attached patch fixes this and makes my original
test case work. There's another problem though.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list