summaryrefslogtreecommitdiff
path: root/splash/Splash.cc
diff options
context:
space:
mode:
Diffstat (limited to 'splash/Splash.cc')
-rw-r--r--splash/Splash.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc
index d29215a0..7bd4137d 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -728,6 +728,10 @@ void Splash::drawPixel(int x, int y, SplashColor *color, GBool noClip) {
SplashRGB8P *rgb8p;
SplashBGR8P *bgr8;
+ if ( (unsigned) x >= (unsigned) bitmap->getWidth() ||
+ (unsigned) y >= (unsigned) bitmap->getHeight())
+ return;
+
if (noClip || state->clip->test(x, y)) {
switch (bitmap->mode) {
case splashModeMono1:
@@ -766,6 +770,10 @@ void Splash::drawPixel(int x, int y, SplashPattern *pattern, GBool noClip) {
SplashRGB8P *rgb8p;
SplashBGR8P *bgr8;
+ if ( (unsigned) x >= (unsigned) bitmap->getWidth() ||
+ (unsigned) y >= (unsigned) bitmap->getHeight())
+ return;
+
if (noClip || state->clip->test(x, y)) {
color = pattern->getColor(x, y);
switch (bitmap->mode) {
@@ -810,6 +818,11 @@ void Splash::drawSpan(int x0, int x1, int y, SplashPattern *pattern,
SplashMono1 mask1;
int i, j, n;
+ if ((unsigned) x0 >= (unsigned) bitmap->getWidth() ||
+ (unsigned) x1 >= (unsigned) bitmap->getWidth() ||
+ (unsigned) y >= (unsigned) bitmap->getHeight())
+ return;
+
n = x1 - x0 + 1;
switch (bitmap->mode) {
@@ -909,6 +922,11 @@ void Splash::xorSpan(int x0, int x1, int y, SplashPattern *pattern,
SplashMono1 mask1;
int i, j, n;
+ if ((unsigned) x0 >= (unsigned) bitmap->getWidth() ||
+ (unsigned) x1 >= (unsigned) bitmap->getWidth() ||
+ (unsigned) y >= (unsigned) bitmap->getHeight())
+ return;
+
n = x1 - x0 + 1;
switch (bitmap->mode) {