ffserver_config: check strchr() return for NULL

Should fix FFmpeg Coverity Scan issue #1257013
Signed-off-by: NReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
上级 dd70470d
...@@ -520,7 +520,13 @@ static int ffserver_save_avoption(const char *opt, const char *arg, int type, FF ...@@ -520,7 +520,13 @@ static int ffserver_save_avoption(const char *opt, const char *arg, int type, FF
//explicit private option //explicit private option
snprintf(buff, sizeof(buff), "%s", opt); snprintf(buff, sizeof(buff), "%s", opt);
codec_name = buff; codec_name = buff;
option = strchr(buff, ':'); if(!(option = strchr(buff, ':'))){
report_config_error(config->filename, config->line_num,
AV_LOG_ERROR, &config->errors,
"Syntax error. Unmatched ':'\n");
return -1;
}
buff[option - buff] = '\0'; buff[option - buff] = '\0';
option++; option++;
if ((ret = ffserver_set_codec(ctx, codec_name, config)) < 0) if ((ret = ffserver_set_codec(ctx, codec_name, config)) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册