Fix crash in blenderplayer when scrubbing off screen.

Was cache referencing deleted or NULL items.

Reported by Kopias on irc
This commit is contained in:
Antonis Ryakiotakis 2015-05-21 17:37:11 +02:00
parent a39efae03d
commit f6062638c1
1 changed files with 5 additions and 2 deletions

View File

@ -1154,10 +1154,10 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
/* really basic memory conservation scheme. Keep frames in a fifo queue */
node = inmempicsbase.last;
while (added_images > PLAY_FRAME_CACHE_MAX) {
while (node && added_images > PLAY_FRAME_CACHE_MAX) {
PlayAnimPict *pic = node->data;
if (pic->ibuf != ibuf) {
if (pic->ibuf && pic->ibuf != ibuf) {
LinkData *node_tmp;
IMB_freeImBuf(pic->ibuf);
pic->ibuf = NULL;
@ -1281,6 +1281,9 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
#endif
BLI_freelistN(&picsbase);
BLI_freelistN(&inmempicsbase);
added_images = 0;
#if 0 // XXX25
free_blender();
#else