summaryrefslogtreecommitdiff
path: root/fitz/fitz.h
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-12-20 16:55:25 +0000
committerRobin Watts <robin.watts@artifex.com>2012-12-21 16:26:11 +0000
commit7b3f902a25dd901515cf3b267c18bcaef4cb2297 (patch)
tree0e099df50514f0df77111e41a9f78612906999e0 /fitz/fitz.h
parent349eeba4e75e5de284e6f29f906643b466eaa368 (diff)
downloadmupdf-7b3f902a25dd901515cf3b267c18bcaef4cb2297.tar.xz
Bug 593603: Fix problems with tiling.
Two problems with tiling are fixed here. Firstly, if the tiling bounds are huge, the 'patch' region (the region we are writing into), can overflow, causing a SEGV due to the paint code being very confused by pixmaps that go from just under INT_MAX to just over INT_MIN. Fix this by checking explicitly for overflow in these bounds. If the tiles are stupidly huge, but the scissor is small, we can end up looping many more times than we need to. We fix mapping the scissor region back through the inverse transform, and intersecting this with the pattern area. Problem found in 4201.pdf.SIGSEGV.622.3560, a test file supplied by Mateusz "j00ru" Jurczyk and Gynvael Coldwind of the Google Security Team using Address Sanitizer. Many thanks!
Diffstat (limited to 'fitz/fitz.h')
-rw-r--r--fitz/fitz.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h
index 19732e42..1bbedd05 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -1029,6 +1029,13 @@ fz_rect fz_union_rect(fz_rect a, fz_rect b);
fz_bbox fz_union_bbox(fz_bbox a, fz_bbox b);
/*
+ fz_expand_bbox: Expand a bbox by a given amount in all directions.
+
+ Does not throw exceptions.
+*/
+fz_bbox fz_expand_bbox(fz_bbox b, int expand);
+
+/*
fz_translate_bbox: Translate bounding box.
Translate a bbox by a given x and y offset. Allows for overflow.