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>
pull/388/head
Michael Niedermayer 2 years ago
parent 1182bbb2c3
commit c5bd689655
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 6
      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);

Loading…
Cancel
Save