[MPlayer-cvslog] CVS: main m_option.c,1.36,1.37
Reimar Döffinger CVS
syncmail at mplayerhq.hu
Fri Jun 17 10:15:10 CEST 2005
CVS change done by Reimar Döffinger CVS
Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv7412
Modified Files:
m_option.c
Log Message:
Fix crash with e.g. -vf scale=::
Index: m_option.c
===================================================================
RCS file: /cvsroot/mplayer/main/m_option.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- m_option.c 14 May 2005 12:49:18 -0000 1.36
+++ m_option.c 17 Jun 2005 08:15:08 -0000 1.37
@@ -1261,8 +1261,16 @@
last_ptr = ptr+1;
}
if(r < 0) return r;
+ if (!last_ptr[0]) // count an empty field at the end, too
+ nold++;
+ if (nold > nopts) {
+ mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Too many options for %s\n", name);
+ return M_OPT_OUT_OF_RANGE;
+ }
if(!_ret) // Just test
return 1;
+ if (n == 0) // No options or only empty options
+ return 1;
ret = malloc((n+2)*2*sizeof(char*));
n = nold = 0;
@@ -1309,6 +1317,8 @@
return r;
if(!dst)
return 1;
+ if (!opts) // no arguments given
+ return 1;
for(r = 0 ; opts[r] ; r += 2)
m_struct_set(desc,dst,opts[r],opts[r+1]);
More information about the MPlayer-cvslog
mailing list