Using strtod() instead of atofp() to support a lot of digits after dot in
"start" parameter value.
Igor Sysoev
10 years ago
498 | 498 | |
499 | 499 | if (ngx_http_arg(r, (u_char *) "start", 5, &value) == NGX_OK) { |
500 | 500 | |
501 | start = ngx_atofp(value.data, value.len, 3); | |
502 | ||
503 | if (start != NGX_ERROR) { | |
501 | /* | |
502 | * A Flash player may send start value with a lot of digits | |
503 | * after dot so strtod() is used instead of atofp(). NaNs and | |
504 | * infinities become negative numbers after (int) conversion. | |
505 | */ | |
506 | ||
507 | ngx_set_errno(0); | |
508 | start = (int) (strtod((char *) value.data, NULL) * 1000); | |
509 | ||
510 | if (ngx_errno == 0 && start >= 0) { | |
504 | 511 | r->allow_ranges = 0; |
505 | 512 | |
506 | 513 | mp4 = ngx_pcalloc(r->pool, sizeof(ngx_http_mp4_file_t)); |