fix for [#10458] Rc4 Blender crash when activate playback FPS than Alt+A to play...
authorCampbell Barton <ideasman42@gmail.com>
Mon, 5 May 2008 06:30:19 +0000 (06:30 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 5 May 2008 06:30:19 +0000 (06:30 +0000)
source/blender/src/drawview.c

index b0d25636cf2e9517f1a32a488996e5d2c26bfc8b..b01b7bc151ceb6fba901749e0396ceea40336984 100644 (file)
@@ -3441,12 +3441,13 @@ static void draw_viewport_fps(ScrArea *sa)
                        tot++;
                }
        }
-       
-       redrawtime_index++;
-       if (redrawtime_index >= REDRAW_FRAME_AVERAGE)
-               redrawtime_index = 0;
-       
-       fps = fps / tot;
+       if (tot) {
+               redrawtime_index++;
+               if (redrawtime_index >= REDRAW_FRAME_AVERAGE)
+                       redrawtime_index = 0;
+               
+               fps = fps / tot;
+       }
 #endif
        
        /* is this more then half a frame behind? */
@@ -3577,7 +3578,7 @@ void inner_play_anim_loop(int init, int mode)
                while(redrawtime_index--) {
                        redrawtimes_fps[redrawtime_index] = 0.0;
                }
-               
+               redrawtime_index = 0;
                lredrawtime = 0.0;
                return;
        }