1 |
pva 11/03/01 21:53:28 |
2 |
|
3 |
Added: djview4-4.6-segfault.patch |
4 |
Log: |
5 |
Upstream patch to fix occasional segfault when flipping pages very quickly. |
6 |
|
7 |
(Portage version: 2.1.9.41/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-text/djview4/files/djview4-4.6-segfault.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/djview4/files/djview4-4.6-segfault.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/djview4/files/djview4-4.6-segfault.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: djview4-4.6-segfault.patch |
16 |
=================================================================== |
17 |
From: leonb <leonb> |
18 |
Date: Wed, 24 Nov 2010 01:57:04 +0000 (+0000) |
19 |
Subject: Fixed occasional segfault when flipping pages very quickly. |
20 |
X-Git-Tag: debian/4.6-2~27 |
21 |
X-Git-Url: http://djvu.git.sourceforge.net/git/gitweb.cgi?p=djvu%2Fdjview.git;a=commitdiff_plain;h=108bbca677f58f820cf8ab8653fc41b25ce6436f |
22 |
|
23 |
Fixed occasional segfault when flipping pages very quickly. |
24 |
--- |
25 |
|
26 |
diff --git a/src/qdjvuwidget.cpp b/src/qdjvuwidget.cpp |
27 |
index 7635b52..281d12b 100644 |
28 |
--- a/src/qdjvuwidget.cpp |
29 |
+++ b/src/qdjvuwidget.cpp |
30 |
@@ -1711,14 +1711,17 @@ QDjVuPrivate::updatePosition(const QPoint &point, bool click, bool links) |
31 |
return; |
32 |
// emit pointerposition signal |
33 |
PageInfo info; |
34 |
- Page *p = pageMap[pos.pageNo]; |
35 |
- info.pageno = pos.pageNo; |
36 |
- info.width = p->width; |
37 |
- info.height = p->height; |
38 |
- info.dpi = p->dpi; |
39 |
- info.segment = widget->getSegmentForRect(selectedRect, info.pageno); |
40 |
- info.selected = selectedRect; |
41 |
- emit widget->pointerPosition(pos, info); |
42 |
+ Page *p = pageMap.value(pos.pageNo,0); |
43 |
+ if (p != 0) |
44 |
+ { |
45 |
+ info.pageno = pos.pageNo; |
46 |
+ info.width = p->width; |
47 |
+ info.height = p->height; |
48 |
+ info.dpi = p->dpi; |
49 |
+ info.segment = widget->getSegmentForRect(selectedRect, info.pageno); |
50 |
+ info.selected = selectedRect; |
51 |
+ emit widget->pointerPosition(pos, info); |
52 |
+ } |
53 |
// check mapareas |
54 |
if (links) |
55 |
checkCurrentMapArea(); |
56 |
@@ -5255,16 +5258,16 @@ QDjVuWidget::nextPage(void) |
57 |
int pageNo = page(); |
58 |
const QRect &dr = priv->deskRect; |
59 |
const QRect &vr = priv->visibleRect; |
60 |
- const QRect &cr = priv->pageMap[pageNo]->rect; |
61 |
+ const Page *pg = priv->pageMap.value(pageNo,0); |
62 |
while (pageNo < priv->numPages - 1) |
63 |
{ |
64 |
pageNo += 1; |
65 |
- if (priv->layoutChange || !priv->pageMap.contains(pageNo)) |
66 |
+ if (priv->layoutChange || !priv->pageMap.contains(pageNo) || !pg) |
67 |
break; |
68 |
// Skip pages until we get a meaningful change. |
69 |
const QRect &pr = priv->pageMap[pageNo]->rect; |
70 |
if (! vr.contains(pr)) |
71 |
- if (pr.top() != cr.top() || vr.width() < dr.width()) |
72 |
+ if (pr.top() != pg->rect.top() || vr.width() < dr.width()) |
73 |
break; |
74 |
} |
75 |
setPage(pageNo); |
76 |
@@ -5277,16 +5280,16 @@ QDjVuWidget::prevPage(void) |
77 |
int pageNo = page(); |
78 |
const QRect &dr = priv->deskRect; |
79 |
const QRect &vr = priv->visibleRect; |
80 |
- const QRect &cr = priv->pageMap[pageNo]->rect; |
81 |
+ const Page *pg = priv->pageMap.value(pageNo,0); |
82 |
while (pageNo > 0) |
83 |
{ |
84 |
pageNo -= 1; |
85 |
- if (priv->layoutChange || !priv->pageMap.contains(pageNo)) |
86 |
+ if (priv->layoutChange || !priv->pageMap.contains(pageNo) || !pg) |
87 |
break; |
88 |
// Skip pages until we get a meaningful change. |
89 |
const QRect &pr = priv->pageMap[pageNo]->rect; |
90 |
if (! vr.contains(pr)) |
91 |
- if (pr.top() != cr.top() || vr.width() < dr.width()) |
92 |
+ if (pr.top() != pg->rect.top() || vr.width() < dr.width()) |
93 |
break; |
94 |
} |
95 |
setPage(pageNo); |