[FFmpeg-cvslog] avformat/mxfdec: Avoid some redundant writing to tables in mxf_compute_ptses_fake_index()

Michael Niedermayer git at videolan.org
Thu Sep 22 18:44:55 EEST 2022


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep 11 16:27:17 2022 +0200| [c5bd689655332232d370d6087e9d8bfc509e623b] | committer: Michael Niedermayer

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 at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c5bd689655332232d370d6087e9d8bfc509e623b
---

 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);



More information about the ffmpeg-cvslog mailing list