From c5bd689655332232d370d6087e9d8bfc509e623b Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 11 Sep 2022 16:27:17 +0200 Subject: [PATCH] avformat/mxfdec: Avoid some redundant writing to tables in mxf_compute_ptses_fake_index() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit offsets suggested by Tomas Härdin Signed-off-by: Michael Niedermayer --- libavformat/mxfdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 1493a2a958..badd2be224 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1940,10 +1940,10 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta if (index_table->nb_ptses <= 0) return 0; - if (!(index_table->ptses = av_calloc(index_table->nb_ptses, sizeof(int64_t))) || + if (!(index_table->ptses = av_malloc_array(index_table->nb_ptses, sizeof(int64_t))) || !(index_table->fake_index = av_calloc(index_table->nb_ptses, sizeof(AVIndexEntry))) || - !(index_table->offsets = av_calloc(index_table->nb_ptses, sizeof(int8_t))) || - !(flags = av_calloc(index_table->nb_ptses, sizeof(uint8_t)))) { + !(index_table->offsets = av_malloc_array(index_table->nb_ptses, sizeof(int8_t))) || + !(flags = av_malloc_array(index_table->nb_ptses, sizeof(uint8_t)))) { av_freep(&index_table->ptses); av_freep(&index_table->fake_index); av_freep(&index_table->offsets);