Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c4bf0ae

Browse files
committed
Fix AGG crash when rendering extremely long horizontal lines.
When AGG rasterizes a horizontal line, it has code to check if the computations will overflow its fixed-precision coordinate math. If an hline is too wide, it will subdivide the line into two pieces until the overflow is avoided. Except a `return` statement was missing, so overflow-y code ran as well as the subdivided code! Leading to negative coordinates and a crash. This only happens for lines that span more than something like 32768 pixels in the X direction, so it's not something that happens in regular usage.
1 parent 5b89c9c commit c4bf0ae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

extern/agg24-svn/include/agg_rasterizer_cells_aa.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ namespace agg
329329
int cy = (y1 + y2) >> 1;
330330
line(x1, y1, cx, cy);
331331
line(cx, cy, x2, y2);
332+
return;
332333
}
333334

334335
int dy = y2 - y1;

0 commit comments

Comments
 (0)