Mercurial > hg > nginx
changeset 2834:0449d289256c
test finalized image filter context before testing image_filter off
this fixes SIGFPE if image filter errors are passed to named location
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 12 May 2009 12:05:29 +0000 |
parents | cc5d214387f4 |
children | fbb1918a85e3 |
files | src/http/modules/ngx_http_image_filter_module.c |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_image_filter_module.c Tue May 12 09:35:14 2009 +0000 +++ b/src/http/modules/ngx_http_image_filter_module.c Tue May 12 12:05:29 2009 +0000 @@ -162,6 +162,13 @@ return ngx_http_next_header_filter(r); } + ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module); + + if (ctx) { + ngx_http_set_ctx(r, NULL, ngx_http_image_filter_module); + return ngx_http_next_header_filter(r); + } + conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module); if (conf->filter == NGX_HTTP_IMAGE_OFF) { @@ -181,13 +188,6 @@ return NGX_ERROR; } - ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module); - - if (ctx) { - ngx_http_set_ctx(r, NULL, ngx_http_image_filter_module); - return ngx_http_next_header_filter(r); - } - ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_image_filter_ctx_t)); if (ctx == NULL) { return NGX_ERROR;