~ubuntu-branches/ubuntu/raring/agg/raring

« back to all changes in this revision

Viewing changes to debian/patches/05-fix-recursion-crash.patch

  • Committer: Package Import Robot
  • Author(s): Andrea Veri
  • Date: 2012-05-01 21:31:31 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20120501213131-j45720h6afvr00zx
Tags: 2.5+dfsg1-7
* debian/patches/08-fix-kfreebsd-ftbfs.patch:
  - added to prevent a FTBFS on kfreebsd-*. (Closes: #671069)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Author: Brian Murray <brian@ubuntu.com>
 
2
Description: Avoid a crash caused by an infinite recursion when 
 
3
 drawing extremely long lines. (LP #344849)
 
4
 
 
5
diff -urNad agg-2.5+dfsg1~/include/agg_rasterizer_cells_aa.h agg-2.5+dfsg1/include/agg_rasterizer_cells_aa.h
 
6
--- agg-2.5+dfsg1~/include/agg_rasterizer_cells_aa.h    2007-10-10 15:06:16.000000000 -0700
 
7
+++ agg-2.5+dfsg1/include/agg_rasterizer_cells_aa.h     2009-04-02 18:34:07.000000000 -0700
 
8
@@ -333,6 +333,12 @@
 
9
         {
 
10
             int cx = (x1 + x2) >> 1;
 
11
             int cy = (y1 + y2) >> 1;
 
12
+
 
13
+            // Bail if values are so large they are likely to wrap
 
14
+            if ((std::abs(x1) >= std::numeric_limits<int>::max()/2) || (std::abs(y1) >= std::numeric_limits<int>::max()/2) ||
 
15
+                (std::abs(x2) >= std::numeric_limits<int>::max()/2) || (std::abs(y2) >= std::numeric_limits<int>::max()/2))
 
16
+                    return;
 
17
+
 
18
             line(x1, y1, cx, cy);
 
19
             line(cx, cy, x2, y2);
 
20
         }