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

« back to all changes in this revision

Viewing changes to include/agg_rasterizer_cells_aa.h

  • 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:
40
40
#define AGG_RASTERIZER_CELLS_AA_INCLUDED
41
41
 
42
42
#include <string.h>
43
 
#include <math.h>
 
43
#include <cstdlib>
 
44
#include <limits>
44
45
#include "agg_math.h"
45
46
#include "agg_array.h"
46
47
 
333
334
        {
334
335
            int cx = (x1 + x2) >> 1;
335
336
            int cy = (y1 + y2) >> 1;
 
337
 
 
338
            // Bail if values are so large they are likely to wrap
 
339
            if ((std::abs(x1) >= std::numeric_limits<int>::max()/2) || (std::abs(y1) >= std::numeric_limits<int>::max()/2) ||
 
340
                (std::abs(x2) >= std::numeric_limits<int>::max()/2) || (std::abs(y2) >= std::numeric_limits<int>::max()/2))
 
341
                    return;
 
342
 
336
343
            line(x1, y1, cx, cy);
337
344
            line(cx, cy, x2, y2);
338
345
        }