From f4929133d7d9e02d1178f3b617798d753d779803 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 1 Mar 2009 16:12:44 +0000 Subject: [PATCH] - Fixed a crash in DUMB when loading invalid files. SVN r1457 (trunk) --- dumb/src/it/itrender.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dumb/src/it/itrender.c b/dumb/src/it/itrender.c index 87929e6fd..b6f478dd6 100644 --- a/dumb/src/it/itrender.c +++ b/dumb/src/it/itrender.c @@ -3985,6 +3985,7 @@ static int process_tick(DUMB_IT_SIGRENDERER *sigrenderer) process_all_playing(sigrenderer); + if (sigrenderer->tempo > 0) { LONG_LONG t = sigrenderer->sub_time_left + ((LONG_LONG)TICK_TIME_DIVIDEND << 16) / sigrenderer->tempo; sigrenderer->time_left += (int)(t >> 16); @@ -4791,6 +4792,13 @@ static DUMB_IT_SIGRENDERER *init_sigrenderer(DUMB_IT_SIGDATA *sigdata, int n_cha sigrenderer->ramp_style = 0; sigrenderer->globalvolume = sigdata->global_volume; sigrenderer->tempo = sigdata->tempo; + if (sigrenderer->tempo == 0) + { + free(callbacks); + dumb_destroy_click_remover_array(n_channels, cr); + free(sigrenderer); + return NULL; + } for (i = 0; i < DUMB_IT_N_CHANNELS; i++) { IT_CHANNEL *channel = &sigrenderer->channel[i];