Modified mj2_init_stdmovie. Check for division by zero at line 212: tk->sample[j].sample_delta = tk->timescale / tk->sample_rate;

Thanks to Valentin Mesaros !
This commit is contained in:
Francois-Olivier Devaux 2005-05-20 07:59:01 +00:00
parent 29b6a4307a
commit 1b0a585256
1 changed files with 4 additions and 1 deletions

View File

@ -206,8 +206,11 @@ int mj2_init_stdmovie(mj2_movie_t * movie)
tk->sampletochunk[0].samples_per_chunk = 1;
tk->sampletochunk[0].sample_descr_idx = 1;
for (j = 0; j < tk->num_samples; j++)
for (j = 0; j < tk->num_samples; j++) {
if (tk->sample_rate == 0)
tk->sample_rate = 25;
tk->sample[j].sample_delta = tk->timescale / tk->sample_rate;
}
tk->num_tts = 1;
tk->tts = (mj2_tts_t *) malloc(tk->num_tts * sizeof(mj2_tts_t));