Commit 557668e8 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avformat/dss: Use AV_DICT_DONT_STRDUP_VAL to save a malloc+memcpy

Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent 3ab16d09
...@@ -103,15 +103,11 @@ static int dss_read_metadata_string(AVFormatContext *s, unsigned int offset, ...@@ -103,15 +103,11 @@ static int dss_read_metadata_string(AVFormatContext *s, unsigned int offset,
ret = avio_read(s->pb, value, size); ret = avio_read(s->pb, value, size);
if (ret < size) { if (ret < size) {
ret = ret < 0 ? ret : AVERROR_EOF; av_free(value);
goto exit; return ret < 0 ? ret : AVERROR_EOF;
} }
ret = av_dict_set(&s->metadata, key, value, 0); return av_dict_set(&s->metadata, key, value, AV_DICT_DONT_STRDUP_VAL);
exit:
av_free(value);
return ret;
} }
static int dss_read_header(AVFormatContext *s) static int dss_read_header(AVFormatContext *s)
......
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