aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2015-10-03 23:48:38 +0200
committerMarton Balint <cus@passwd.hu>2015-10-05 00:16:12 +0200
commit80b6cc4214a8d90e50ebb49ff1088c3223d2c680 (patch)
treefcb23bbc5c9c4d7bf5e0ccc70ba1348c695fa59f /libavformat
parent854972b53dc7bf3ab59354d430d3b0e7580315f0 (diff)
downloadffmpeg-80b6cc4214a8d90e50ebb49ff1088c3223d2c680.tar.gz
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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/concatdec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 88b6dbe6a4..832b7f4b9c 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -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);