diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-11-10 05:07:33 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-10 17:52:14 +0100 |
commit | ad1b0a12f34d57ed5bfb952ce67bce8f48b3ec0e (patch) | |
tree | 1d6ad99462f1e776b242658779477f2a7f017b26 /libavformat | |
parent | 9519c8dbb749c8c658b4ada6f6e03cea7521e611 (diff) | |
download | ffmpeg-ad1b0a12f34d57ed5bfb952ce67bce8f48b3ec0e.tar.gz |
avformat/mov: Use AV_DICT_DONT_STRDUP_VAL to avoid av_strdup
This will likely also fix CID 1452574 and 1452565, false positives
resulting from Coverity thinking that av_dict_set() automatically
frees its key and value parameters (even without the
AV_DICT_DONT_STRDUP_* flags).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 890c6e85b8..589576b529 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1129,8 +1129,8 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom) return ret; } comp_brands_str[comp_brand_size] = 0; - av_dict_set(&c->fc->metadata, "compatible_brands", comp_brands_str, 0); - av_freep(&comp_brands_str); + av_dict_set(&c->fc->metadata, "compatible_brands", + comp_brands_str, AV_DICT_DONT_STRDUP_VAL); return 0; } @@ -5794,8 +5794,8 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom) return AVERROR_INVALIDDATA; } buffer[len] = '\0'; - av_dict_set(&c->fc->metadata, "xmp", buffer, 0); - av_free(buffer); + av_dict_set(&c->fc->metadata, "xmp", + buffer, AV_DICT_DONT_STRDUP_VAL); } else { // skip all uuid atom, which makes it fast for long uuid-xmp file ret = avio_skip(pb, len); |