diff --git a/libavformat/mov.c b/libavformat/mov.c index 5a2ab732d3..c85d3a6eda 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2783,6 +2783,9 @@ static void mov_build_index(MOVContext *mov, AVStream *st) } else { unsigned chunk_samples, total = 0; + if (!sc->chunk_count) + return; + // compute total chunk count for (i = 0; i < sc->stsc_count; i++) { unsigned count, chunk_count;