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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-03-13 22:40:36 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-03-13 22:40:36 +0300
commit15215493bf9d1d08e650109e6eb6189fc76e289e (patch)
treebf04a7c508fca916b22518439b02ab8901c205db /source/blender/src/filesel.c
parentecc4ccf68f057788cbd1e117672b8531ca7f286f (diff)
Two bugfixes:
- Clicking below the list of items in the shift+f4 databrowser could crash. - Text window crashed when making it zero size.
Diffstat (limited to 'source/blender/src/filesel.c')
-rw-r--r--source/blender/src/filesel.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c
index 089e37ce51e..597611344c6 100644
--- a/source/blender/src/filesel.c
+++ b/source/blender/src/filesel.c
@@ -637,7 +637,7 @@ void swapselect_file(SpaceFile *sfile)
static int find_active_file(SpaceFile *sfile, short x, short y)
{
- int ofs;
+ int ofs, act;
if(y > textrct.ymax) y= textrct.ymax;
if(y <= textrct.ymin) y= textrct.ymin+1;
@@ -646,8 +646,12 @@ static int find_active_file(SpaceFile *sfile, short x, short y)
if(ofs<0) ofs= 0;
ofs*= (textrct.ymax-textrct.ymin);
- return sfile->ofs+ (ofs+textrct.ymax-y)/FILESEL_DY;
+ act= sfile->ofs+ (ofs+textrct.ymax-y)/FILESEL_DY;
+ if(act<0 || act>=sfile->totfile)
+ act= -1;
+
+ return act;
}
@@ -1453,7 +1457,7 @@ static void filesel_execute(SpaceFile *sfile)
*sfile->menup= -1;
- if(sfile->act>=0) {
+ if(sfile->act>=0 && sfile->act<sfile->totfile) {
if(sfile->filelist) {
files= sfile->filelist+sfile->act;
if ( strcmp(files->relname, sfile->file)==0) {
@@ -2402,7 +2406,7 @@ static void active_file_object(SpaceFile *sfile)
if(filesel_has_func(sfile)) return;
if( strcmp(sfile->dir, "Object/")==0 ) {
- if(sfile->act >= 0) {
+ if(sfile->act >= 0 && sfile->act < sfile->totfile) {
ob= (Object *)sfile->filelist[sfile->act].poin;