diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-26 20:07:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-26 20:07:31 +0300 |
commit | cfd3b11630161a802233b905f7076899888c6fe3 (patch) | |
tree | 29653a787a140e0769256c50e823288821c8c802 /source/blender/editors/space_info | |
parent | cf0820d6285c3a9379dd529ee50dcf39e2efa21c (diff) |
fix building blenderplayer and a divide by zero bug with the console view.
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r-- | source/blender/editors/space_info/textview.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index 315130136a2..343130d96ce 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -238,6 +238,7 @@ int textview_draw(TextViewContext *tvc, int draw, int mval[2], void **mouse_pick assert(cdc.cwidth > 0); cdc.lheight= tvc->lheight; cdc.console_width= (tvc->winx - (CONSOLE_DRAW_SCROLL + CONSOLE_DRAW_MARGIN*2) ) / cdc.cwidth; + CLAMP(cdc.console_width, 1, INT_MAX); /* avoid divide by zero on small windows */ cdc.winx= tvc->winx-(CONSOLE_DRAW_MARGIN+CONSOLE_DRAW_SCROLL); cdc.ymin= tvc->ymin; cdc.ymax= tvc->ymax; |