# HG changeset patch # User Igor Sysoev # Date 1317374308 0 # Node ID 67a4654ba7d942580332af4120ea22c18624857d # Parent d9636bf3f159016f3303d6c7e1fd06054222a974 Using strtod() instead of atofp() to support a lot of digits after dot in "start" parameter value. diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c --- a/src/http/modules/ngx_http_mp4_module.c +++ b/src/http/modules/ngx_http_mp4_module.c @@ -499,9 +499,16 @@ ngx_http_mp4_handler(ngx_http_request_t if (ngx_http_arg(r, (u_char *) "start", 5, &value) == NGX_OK) { - start = ngx_atofp(value.data, value.len, 3); - - if (start != NGX_ERROR) { + /* + * A Flash player may send start value with a lot of digits + * after dot so strtod() is used instead of atofp(). NaNs and + * infinities become negative numbers after (int) conversion. + */ + + ngx_set_errno(0); + start = (int) (strtod((char *) value.data, NULL) * 1000); + + if (ngx_errno == 0 && start >= 0) { r->allow_ranges = 0; mp4 = ngx_pcalloc(r->pool, sizeof(ngx_http_mp4_file_t));