Commit 9f6ca28e authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/concatdec: Check file variable before dereferencing

Fixes CID1322328
Reviewed-by: 's avatarGanesh Ajjanagadde <gajjanag@mit.edu>
Reviewed-by: 's avatarNicolas George <george@nsup.org>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5131ba56
...@@ -394,6 +394,11 @@ static int concat_read_header(AVFormatContext *avf) ...@@ -394,6 +394,11 @@ static int concat_read_header(AVFormatContext *avf)
av_log(avf, AV_LOG_ERROR, "Line %d: packet metadata required\n", line); av_log(avf, AV_LOG_ERROR, "Line %d: packet metadata required\n", line);
FAIL(AVERROR_INVALIDDATA); FAIL(AVERROR_INVALIDDATA);
} }
if (!file) {
av_log(avf, AV_LOG_ERROR, "Line %d: %s without file\n",
line, keyword);
FAIL(AVERROR_INVALIDDATA);
}
if ((ret = av_dict_parse_string(&file->metadata, metadata, "=", "", 0)) < 0) { 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_log(avf, AV_LOG_ERROR, "Line %d: failed to parse metadata string\n", line);
av_freep(&metadata); av_freep(&metadata);
......
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