diff options
author | szabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-04-10 23:56:38 +0000 |
---|---|---|
committer | szabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-04-10 23:56:38 +0000 |
commit | 5f20b1fd928cb74cec7dfdd8f2b2e2904555e6b6 (patch) | |
tree | 26412df3ca4ac83d2d23c37ece33bc12db430c3d /codec-cfg.c | |
parent | 1875f44dbd1a432a702c10208eae5ae177879673 (diff) | |
download | mpv-5f20b1fd928cb74cec7dfdd8f2b2e2904555e6b6.tar.bz2 mpv-5f20b1fd928cb74cec7dfdd8f2b2e2904555e6b6.tar.xz |
guid
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@336 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'codec-cfg.c')
-rw-r--r-- | codec-cfg.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/codec-cfg.c b/codec-cfg.c index 3bf22000db..bbf0a5f13f 100644 --- a/codec-cfg.c +++ b/codec-cfg.c @@ -338,6 +338,7 @@ codecs_t **parse_codec_cfg(char *cfgfile) codecs_t *codec = NULL; // current codec codecs_t **codecsp = NULL;// points to audio_codecs or to video_codecs static codecs_t *ret_codecs[2] = {NULL,NULL}; + char *endptr; // strtoul()... int *nr_codecsp; int codec_type; /* TYPE_VIDEO/TYPE_AUDIO */ int tmp, i; @@ -454,15 +455,19 @@ codecs_t **parse_codec_cfg(char *cfgfile) } else if (!strcmp(token[0], "guid")) { if (get_token(11, 11) < 0) goto err_out_parse_error; -#warning GUID-nak szammal kell kezdodni!!!!!!!! ez igy ok? - for (i = 0; i < 11; i++) - if (!isdigit(*token[i])) - goto err_out_parse_error; - codec->guid.f1=strtoul(token[0],NULL,0); - codec->guid.f2=strtoul(token[1],NULL,0); - codec->guid.f3=strtoul(token[2],NULL,0); + codec->guid.f1=strtoul(token[0],&endptr,0); + if (*endptr != '\0' && *endptr != ',') + goto err_out_parse_error; + codec->guid.f2=strtoul(token[1],&endptr,0); + if (*endptr != '\0' && *endptr != ',') + goto err_out_parse_error; + codec->guid.f3=strtoul(token[2],&endptr,0); + if (*endptr != '\0' && *endptr != ',') + goto err_out_parse_error; for (i = 0; i < 8; i++) { - codec->guid.f4[i]=strtoul(token[i + 3],NULL,0); + codec->guid.f4[i]=strtoul(token[i + 3],&endptr,0); + if (*endptr != '\0' && *endptr != ',') + goto err_out_parse_error; } } else if (!strcmp(token[0], "out")) { if (get_token(1, 2) < 0) |