mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/mxfdec: use av_asprintf()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
2465fe1302
commit
750a81ba99
|
@ -2017,7 +2017,7 @@ static MXFStructuralComponent* mxf_resolve_sourceclip(MXFContext *mxf, UID *stro
|
|||
static int mxf_parse_package_comments(MXFContext *mxf, AVDictionary **pm, MXFPackage *package)
|
||||
{
|
||||
MXFTaggedValue *tag;
|
||||
int size, i;
|
||||
int i;
|
||||
char *key = NULL;
|
||||
|
||||
for (i = 0; i < package->comment_count; i++) {
|
||||
|
@ -2025,12 +2025,10 @@ static int mxf_parse_package_comments(MXFContext *mxf, AVDictionary **pm, MXFPac
|
|||
if (!tag || !tag->name || !tag->value)
|
||||
continue;
|
||||
|
||||
size = strlen(tag->name) + 8 + 1;
|
||||
key = av_mallocz(size);
|
||||
key = av_asprintf("comment_%s", tag->name);
|
||||
if (!key)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
snprintf(key, size, "comment_%s", tag->name);
|
||||
av_dict_set(pm, key, tag->value, AV_DICT_DONT_STRDUP_KEY);
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue