if (duration > 0 &&
duration <= INT64_MAX - sc->duration_for_fps &&
- total_sample_count <= INT64_MAX - sc->nb_frames_for_fps
+ total_sample_count <= INT_MAX - sc->nb_frames_for_fps
) {
sc->duration_for_fps += duration;
sc->nb_frames_for_fps += total_sample_count;
av_log(c->fc, AV_LOG_TRACE, "first sample flags 0x%x\n", first_sample_flags);
// realloc space for new index entries
- if((unsigned)st->nb_index_entries + entries >= UINT_MAX / sizeof(AVIndexEntry)) {
+ if((uint64_t)st->nb_index_entries + entries >= UINT_MAX / sizeof(AVIndexEntry)) {
entries = UINT_MAX / sizeof(AVIndexEntry) - st->nb_index_entries;
av_log(c->fc, AV_LOG_ERROR, "Failed to add index entry\n");
}
sc->data_size += sample_size;
if (sample_duration <= INT64_MAX - sc->duration_for_fps &&
- 1 <= INT64_MAX - sc->nb_frames_for_fps
+ 1 <= INT_MAX - sc->nb_frames_for_fps
) {
sc->duration_for_fps += sample_duration;
sc->nb_frames_for_fps ++;
return 0;
}
-static int mov_probe(AVProbeData *p)
+static int mov_probe(const AVProbeData *p)
{
int64_t offset;
uint32_t tag;
}
/* adjust stsd index */
+ if (sc->chunk_count) {
time_sample = 0;
for (i = 0; i < sc->stsc_count; i++) {
int64_t next = time_sample + mov_get_stsc_samples(sc, i);
av_assert0(next == (int)next);
time_sample = next;
}
+ }
return sample;
}
.read_packet = mov_read_packet,
.read_close = mov_read_close,
.read_seek = mov_read_seek,
- .flags = AVFMT_NO_BYTE_SEEK,
+ .flags = AVFMT_NO_BYTE_SEEK | AVFMT_SEEK_TO_PTS,
};