diff --git a/libavformat/mov.c b/libavformat/mov.c index effa46120f..71e8f7ae8f 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4031,7 +4031,8 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) } // allocate the index ranges array - msc->index_ranges = av_calloc((msc->elst_count + 1), sizeof(msc->index_ranges[0])); + msc->index_ranges = av_malloc_array(msc->elst_count + 1, + sizeof(msc->index_ranges[0])); if (!msc->index_ranges) { av_log(mov->fc, AV_LOG_ERROR, "Cannot allocate index ranges buffer\n"); return;