Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-04-04 19:03:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-04-04 19:03:45 +0400
commit670d499c8b5bd08c3e3e22d6f1712f0fb2040b4f (patch)
tree0b18488bf0f676ed4c0ab1844c5a0423559423ff /source/blender/blenfont
parentbc149e0fbe85819935eceb1ae5d54578e37d5247 (diff)
added negative bounds checks so drawing text into a buffer wont crash.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_font.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 2289cf7fc89..f7c5531f0ac 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -232,8 +232,8 @@ void blf_font_buffer(FontBLF *font, char *str)
yb= g->pitch < 0 ? 0 : g->height-1;
if (font->b_fbuf) {
- for (y= 0; y < height_clip; y++) {
- for (x= 0; x < width_clip; x++) {
+ for (y=(chy >= 0 ? 0:-chy); y < height_clip; y++) {
+ for (x=(chx >= 0 ? 0:-chx); x < width_clip; x++) {
a= *(g->bitmap + x + (yb * g->pitch)) / 255.0f;