summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-09-11 16:27:17 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-22 17:44:04 +0200
commitc5bd689655332232d370d6087e9d8bfc509e623b (patch)
treeeb53bbf1e6bc24e0b80efd4db2a33c0134701d45
parent1182bbb2c3226260ed672920251e3410bde8c6c9 (diff)
avformat/mxfdec: Avoid some redundant writing to tables in mxf_compute_ptses_fake_index()
offsets suggested by Tomas Härdin Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mxfdec.c6
1 files 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);