diff options
Diffstat (limited to 'render/rendertext.c')
-rw-r--r-- | render/rendertext.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/render/rendertext.c b/render/rendertext.c index cc181657..81afeafa 100644 --- a/render/rendertext.c +++ b/render/rendertext.c @@ -33,13 +33,13 @@ static void blitcolorglyph(fz_pixmap *out, fz_glyph *gl, int xo, int yo, fz_rend { for (sx = 0; sx < gl->w; sx++) { - dx = xo + sx + gl->lsb - out->x; dy = yo - sy + gl->top - out->y; + if (dy < 0) continue; + if (dy >= out->h) break; + dx = xo + sx + gl->lsb - out->x; if (dx < 0) continue; - if (dy < 0) continue; - if (dx >= out->w) continue; - if (dy >= out->h) continue; + if (dx >= out->w) break; sa = gl->bitmap[sx + sy * gl->w]; ssa = 255 - sa; |