Commit 40d9cbdc authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by Michael Niedermayer

avformat/matroskadec: Use AV_DICT_DONT_STRDUP_VAL to save av_strdup

This will likely also fix CID 1452562, a false positive 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: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 34e3810b
...@@ -2403,8 +2403,8 @@ static int matroska_parse_tracks(AVFormatContext *s) ...@@ -2403,8 +2403,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
if (key_id_base64) { if (key_id_base64) {
/* export encryption key id as base64 metadata tag */ /* export encryption key id as base64 metadata tag */
av_dict_set(&st->metadata, "enc_key_id", key_id_base64, 0); av_dict_set(&st->metadata, "enc_key_id", key_id_base64,
av_freep(&key_id_base64); AV_DICT_DONT_STRDUP_VAL);
} }
if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC") && if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC") &&
...@@ -4111,8 +4111,8 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range) ...@@ -4111,8 +4111,8 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range)
} }
end += ret; end += ret;
} }
av_dict_set(&s->streams[0]->metadata, CUE_TIMESTAMPS, buf, 0); av_dict_set(&s->streams[0]->metadata, CUE_TIMESTAMPS,
av_free(buf); buf, AV_DICT_DONT_STRDUP_VAL);
return 0; return 0;
} }
...@@ -4137,8 +4137,8 @@ static int webm_dash_manifest_read_header(AVFormatContext *s) ...@@ -4137,8 +4137,8 @@ static int webm_dash_manifest_read_header(AVFormatContext *s)
if (!matroska->is_live) { if (!matroska->is_live) {
buf = av_asprintf("%g", matroska->duration); buf = av_asprintf("%g", matroska->duration);
if (!buf) return AVERROR(ENOMEM); if (!buf) return AVERROR(ENOMEM);
av_dict_set(&s->streams[0]->metadata, DURATION, buf, 0); av_dict_set(&s->streams[0]->metadata, DURATION,
av_free(buf); buf, AV_DICT_DONT_STRDUP_VAL);
// initialization range // initialization range
// 5 is the offset of Cluster ID. // 5 is the offset of Cluster ID.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment