diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-11-10 02:48:21 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-03-24 23:02:30 +0100 |
commit | 557668e8cbd9695cc45a1135e158b81b5c2b6496 (patch) | |
tree | d9e64d4f485675e1fd905714a3fa9b9c0fe61e8b /libavformat/dss.c | |
parent | 3ab16d091e74c9b0b0c81a1367a11f5d267998c2 (diff) | |
download | ffmpeg-557668e8cbd9695cc45a1135e158b81b5c2b6496.tar.gz |
avformat/dss: Use AV_DICT_DONT_STRDUP_VAL to save a malloc+memcpy
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/dss.c')
-rw-r--r-- | libavformat/dss.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libavformat/dss.c b/libavformat/dss.c index 8e0b72fbe5..ae7a259526 100644 --- a/libavformat/dss.c +++ b/libavformat/dss.c @@ -103,15 +103,11 @@ static int dss_read_metadata_string(AVFormatContext *s, unsigned int offset, ret = avio_read(s->pb, value, size); if (ret < size) { - ret = ret < 0 ? ret : AVERROR_EOF; - goto exit; + av_free(value); + return ret < 0 ? ret : AVERROR_EOF; } - ret = av_dict_set(&s->metadata, key, value, 0); - -exit: - av_free(value); - return ret; + return av_dict_set(&s->metadata, key, value, AV_DICT_DONT_STRDUP_VAL); } static int dss_read_header(AVFormatContext *s) |