diff --git a/m_option.c b/m_option.c index fc241ee984..825a085224 100644 --- a/m_option.c +++ b/m_option.c @@ -961,7 +961,9 @@ static int parse_imgfmt(m_option_t* opt,char *name, char *param, void* dst, int mp_msg(MSGT_CFGPARSER, MSGL_INFO, "\n"); return M_OPT_EXIT; } - + + if (sscanf(param, "0x%x", &fmt) != 1) + { for(i = 0 ; mp_imgfmt_list[i].name ; i++) { if(!strcasecmp(param,mp_imgfmt_list[i].name)) { fmt=mp_imgfmt_list[i].fmt; @@ -972,6 +974,7 @@ static int parse_imgfmt(m_option_t* opt,char *name, char *param, void* dst, int mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %s: unknown format name: '%s'\n",name,param); return M_OPT_INVALID; } + } if(dst) *((uint32_t*)dst) = fmt;