mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 11:49:48 +00:00
concatdec: fix metadata memleak on error
Fixes Coverity CID 1323077. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
854972b53d
commit
80b6cc4214
@ -389,16 +389,16 @@ static int concat_read_header(AVFormatContext *avf)
|
||||
file->outpoint = dur;
|
||||
} else if (!strcmp(keyword, "file_packet_metadata")) {
|
||||
char *metadata;
|
||||
metadata = av_get_token((const char **)&cursor, SPACE_CHARS);
|
||||
if (!metadata) {
|
||||
av_log(avf, AV_LOG_ERROR, "Line %d: packet metadata required\n", line);
|
||||
FAIL(AVERROR_INVALIDDATA);
|
||||
}
|
||||
if (!file) {
|
||||
av_log(avf, AV_LOG_ERROR, "Line %d: %s without file\n",
|
||||
line, keyword);
|
||||
FAIL(AVERROR_INVALIDDATA);
|
||||
}
|
||||
metadata = av_get_token((const char **)&cursor, SPACE_CHARS);
|
||||
if (!metadata) {
|
||||
av_log(avf, AV_LOG_ERROR, "Line %d: packet metadata required\n", line);
|
||||
FAIL(AVERROR_INVALIDDATA);
|
||||
}
|
||||
if ((ret = av_dict_parse_string(&file->metadata, metadata, "=", "", 0)) < 0) {
|
||||
av_log(avf, AV_LOG_ERROR, "Line %d: failed to parse metadata string\n", line);
|
||||
av_freep(&metadata);
|
||||
|
Loading…
Reference in New Issue
Block a user