Mercurial > mplayer.hg
changeset 18097:df9633d451dc
avoid crash when running "mplayer -loop" (dereferencing uninitialize pointer).
author | reimar |
---|---|
date | Fri, 14 Apr 2006 21:51:45 +0000 |
parents | f92a441c0442 |
children | 58ace5bcf0ec |
files | parser-mpcmd.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/parser-mpcmd.c Fri Apr 14 21:08:25 2006 +0000 +++ b/parser-mpcmd.c Fri Apr 14 21:51:45 2006 +0000 @@ -140,9 +140,9 @@ if(strcasecmp(opt,"loop") == 0 && (! last_entry || last_entry->child) ) { int l; - char* end; + char* end = NULL; l = (i+1<argc) ? strtol(argv[i+1],&end,0) : 0; - if(*end != '\0') { + if(!end || *end != '\0') { mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The loop option must be an integer: %s\n",argv[i+1]); tmp = ERR_OUT_OF_RANGE; } else {