- MOVFragmentIndexItem * item = &frag_index->item[frag_index->current];
+ MOVFragmentIndexItem *item;
+ if (frag_index->current < 0 ||
+ frag_index->current >= frag_index->nb_items)
+ return NULL;
+
+ item = &frag_index->item[frag_index->current];
if (item->current >= 0 && item->current < item->nb_stream_info)
return &item->stream_info[item->current];
if (item->current >= 0 && item->current < item->nb_stream_info)
return &item->stream_info[item->current];
av_log(c->fc, AV_LOG_TRACE, "track[%u].stsc.entries = %u\n", c->fc->nb_streams - 1, entries);
av_log(c->fc, AV_LOG_TRACE, "track[%u].stsc.entries = %u\n", c->fc->nb_streams - 1, entries);
if (find_prev_closest_index(st, e_old, nb_old, ctts_data_old, ctts_count_old, search_timestamp, AVSEEK_FLAG_ANY,
&index, &ctts_index_old, &ctts_sample_old) < 0) {
av_log(mov->fc, AV_LOG_WARNING,
if (find_prev_closest_index(st, e_old, nb_old, ctts_data_old, ctts_count_old, search_timestamp, AVSEEK_FLAG_ANY,
&index, &ctts_index_old, &ctts_sample_old) < 0) {
av_log(mov->fc, AV_LOG_WARNING,
- "st: %d edit list %"PRId64" Cannot find an index entry before timestamp: %"PRId64".\n"
- "Rounding edit list media time to zero.\n",
+ "st: %d edit list %"PRId64" Cannot find an index entry before timestamp: %"PRId64".\n",