Division by 0
Closed, ArchivedPublic

Description

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


//styken


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;

styken (styken) set Type to Bug.Via Old WorldFeb 26 2004, 11:32 PM
Kent Mein (sirdude) closed this task as "Archived".Via Old WorldMar 2 2004, 5:50 PM
Nobody (None) added a comment.Via Old WorldFeb 26 2004, 11:32 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.

Add Comment