mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
avformat/mxfdec: use av_realloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
9bca8e5341
commit
c5714097eb
@ -433,10 +433,7 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
|
||||
uint64_t footer_partition;
|
||||
uint32_t nb_essence_containers;
|
||||
|
||||
if (mxf->partitions_count+1 >= UINT_MAX / sizeof(*mxf->partitions))
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
tmp_part = av_realloc(mxf->partitions, (mxf->partitions_count + 1) * sizeof(*mxf->partitions));
|
||||
tmp_part = av_realloc_array(mxf->partitions, mxf->partitions_count + 1, sizeof(*mxf->partitions));
|
||||
if (!tmp_part)
|
||||
return AVERROR(ENOMEM);
|
||||
mxf->partitions = tmp_part;
|
||||
@ -563,9 +560,8 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
|
||||
static int mxf_add_metadata_set(MXFContext *mxf, void *metadata_set)
|
||||
{
|
||||
MXFMetadataSet **tmp;
|
||||
if (mxf->metadata_sets_count+1 >= UINT_MAX / sizeof(*mxf->metadata_sets))
|
||||
return AVERROR(ENOMEM);
|
||||
tmp = av_realloc(mxf->metadata_sets, (mxf->metadata_sets_count + 1) * sizeof(*mxf->metadata_sets));
|
||||
|
||||
tmp = av_realloc_array(mxf->metadata_sets, mxf->metadata_sets_count + 1, sizeof(*mxf->metadata_sets));
|
||||
if (!tmp)
|
||||
return AVERROR(ENOMEM);
|
||||
mxf->metadata_sets = tmp;
|
||||
|
Loading…
Reference in New Issue
Block a user