Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(965)

Side by Side Diff: third_party/agg23/0000-bug-466.patch

Issue 1861963002: Fix an infinite loop in agg's stroke_calc_arc(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/agg23/README.pdfium » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 diff --git a/third_party/agg23/agg_math_stroke.h b/third_party/agg23/agg_math_st roke.h
2 index 6d7ba8a..2b06b1b 100644
3 --- a/third_party/agg23/agg_math_stroke.h
4 +++ b/third_party/agg23/agg_math_stroke.h
5 @@ -60,28 +60,30 @@ void stroke_calc_arc(VertexConsumer& out_vertices,
6 }
7 da = FXSYS_acos(width / (width + ((1.0f / 8) / approximation_scale))) * 2;
8 out_vertices.add(coord_type(x + dx1, y + dy1));
9 - if(!ccw) {
10 - if(a1 > a2) {
11 - a2 += 2 * FX_PI;
12 + if (da > 0) {
13 + if (!ccw) {
14 + if (a1 > a2) {
15 + a2 += 2 * FX_PI;
16 }
17 a2 -= da / 4;
18 a1 += da;
19 - while(a1 < a2) {
20 + while (a1 < a2) {
21 out_vertices.add(coord_type(x + (width * FXSYS_cos(a1)),
22 y + (width * FXSYS_sin(a1))));
23 - a1 += da;
24 + a1 += da;
25 }
26 - } else {
27 - if(a1 < a2) {
28 - a2 -= 2 * FX_PI;
29 + } else {
30 + if (a1 < a2) {
31 + a2 -= 2 * FX_PI;
32 }
33 a2 += da / 4;
34 a1 -= da;
35 - while(a1 > a2) {
36 + while (a1 > a2) {
37 out_vertices.add(coord_type(x + (width * FXSYS_cos(a1)),
38 y + (width * FXSYS_sin(a1))));
39 - a1 -= da;
40 + a1 -= da;
41 }
42 + }
43 }
44 out_vertices.add(coord_type(x + dx2, y + dy2));
45 }
OLDNEW
« no previous file with comments | « no previous file | third_party/agg23/README.pdfium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698