diff options
author | Ton Roosendaal <ton@blender.org> | 2011-03-10 15:52:18 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-03-10 15:52:18 +0300 |
commit | 188c4ae055393aa7495508d59c44870f072279d3 (patch) | |
tree | bf3aa6b70970aba98f1c9f4a6ed705ed207958ab /source | |
parent | f13ae69bcd9fdb4fc0964d922acc5d8d84329c93 (diff) |
Bugfix #26442
Very bad crashing in using "Not AA fonts" and drawing length info
on EditMesh. This uses the call BLF_draw_ascii() which apparently
corruptes then badly. Disabled the call for now, and wait for fix.
In the course of testing, added proper strlen storage for draw
in this code.
Added strlen
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 82d7cac1a42..bb298756927 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -575,6 +575,7 @@ typedef struct ViewCachedString { short mval[2]; short xoffs; short flag; + int str_len, pad; /* str is allocated past the end */ } ViewCachedString; @@ -596,6 +597,7 @@ void view3d_cached_text_draw_add(const float co[3], const char *str, short xoffs vos->col.pack= *((int *)col); vos->xoffs= xoffs; vos->flag= flag; + vos->str_len= alloc_len-1; /* allocate past the end */ memcpy(++vos, str, alloc_len); @@ -661,10 +663,10 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa col_pack_prev= vos->col.pack; } if(vos->flag & V3D_CACHE_TEXT_ASCII) { - BLF_draw_default_ascii((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, 65535); /* XXX, use real length */ + BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); } else { - BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, 65535); /* XXX, use real length */ + BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); } } } |