summaryrefslogtreecommitdiff
path: root/libavformat/mxfdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-14 22:16:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-14 22:20:52 +0100
commite3c0fcaddabe91dfcfce4f606a576c79be1a6779 (patch)
treed31741c7d52a321ef25fc26f54acfa892e5e1834 /libavformat/mxfdec.c
parent84ca7c28ce4977cbf71b2c7efbaafea9fc3fbfb2 (diff)
parent1a4e4ad0e0c5486dcab05e54b587672a498dd7cf (diff)
Merge commit '1a4e4ad0e0c5486dcab05e54b587672a498dd7cf'
* commit '1a4e4ad0e0c5486dcab05e54b587672a498dd7cf': mxf: Use av_malloc_array Conflicts: libavformat/mxfdec.c See: 8ce41721a4a29711211f8dad0c86502caf86f4d3 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r--libavformat/mxfdec.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index d6eb7d1899..181bc0a412 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1249,7 +1249,9 @@ static int mxf_compute_index_tables(MXFContext *mxf)
}
}
- if (!(mxf->index_tables = av_calloc(mxf->nb_index_tables, sizeof(MXFIndexTable)))) {
+ mxf->index_tables = av_mallocz_array(mxf->nb_index_tables,
+ sizeof(*mxf->index_tables));
+ if (!mxf->index_tables) {
av_log(mxf->fc, AV_LOG_ERROR, "failed to allocate index tables\n");
ret = AVERROR(ENOMEM);
goto finish_decoding_index;
@@ -1268,8 +1270,12 @@ static int mxf_compute_index_tables(MXFContext *mxf)
for (i = j = 0; j < mxf->nb_index_tables; i += mxf->index_tables[j++].nb_segments) {
MXFIndexTable *t = &mxf->index_tables[j];
- if (!(t->segments = av_calloc(t->nb_segments, sizeof(MXFIndexTableSegment*)))) {
- av_log(mxf->fc, AV_LOG_ERROR, "failed to allocate IndexTableSegment pointer array\n");
+ t->segments = av_mallocz_array(t->nb_segments,
+ sizeof(*t->segments));
+
+ if (!t->segments) {
+ av_log(mxf->fc, AV_LOG_ERROR, "failed to allocate IndexTableSegment"
+ " pointer array\n");
ret = AVERROR(ENOMEM);
goto finish_decoding_index;
}