Division by 0
Closed, ArchivedPublic


Group: V 2.31 release
Resolution: Approved
Category: Interface

Blender: 2.32
OS: Win98Se

Hi I found a nasty division by 0 in filesel.c.

To reproduce you open up fileselector in lower window.
Then resize whole blender window so that no files
shows. Resize it up/down while no files shows, at one
point variable "val" is set to zero and a crash comes!

A simple check for zero fixes this


line 1005 in filesel.c

static int calc_filesel_regel(SpaceFile *sfile, int
nr, int *valx, int *valy)
/* get screen coordinate of a 'regel', dutch
for line */
int val, coll;

nr-= sfile->ofs;

/* amount of lines */
val= (textrct.ymax-textrct.ymin)/FILESEL_DY;
fix: if(val == 0)
fix: coll = 0;
fix: else
coll = nr/val;
nr -= coll*val;


Kent Mein (sirdude) closed this task as Archived.Mar 2 2004, 5:50 PM

This task was automatically closed as archived as part of migration, because the project or tracker this task belonged to is no longer active.