1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Andreas Rheinhardt 2019-11-10 02:48:21 +01:00
parent 3ab16d091e
commit 557668e8cb

View File

@ -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)