diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2013-03-29 17:20:59 +0000 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2013-03-29 17:20:59 +0000 |
commit | 57ab08fd4736de3a6fb143d054091cb5f1f225f0 (patch) | |
tree | c6b0727407b1f22cfb2c708f95abf80920aa2e23 | |
parent | 07c3c53e00b49aa25451a38fdb0aadb875ff8432 (diff) | |
download | nginx-57ab08fd4736de3a6fb143d054091cb5f1f225f0.tar.gz |
Merge of r5098: mp4: fixed handling of too small mdat atoms.
Mp4: fixed handling of too small mdat atoms (ticket #266).
Patch by Gernot Vormayr (with minor changes).
-rw-r--r-- | src/http/modules/ngx_http_mp4_module.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c index d3be23420..e793f77b7 100644 --- a/src/http/modules/ngx_http_mp4_module.c +++ b/src/http/modules/ngx_http_mp4_module.c @@ -750,6 +750,13 @@ ngx_http_mp4_process(ngx_http_mp4_file_t *mp4) *prev = &mp4->mdat_atom; + if (start_offset > mp4->mdat_data.buf->file_last) { + ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0, + "start time is out mp4 mdat atom in \"%s\"", + mp4->file.name.data); + return NGX_ERROR; + } + adjustment = mp4->ftyp_size + mp4->moov_size + ngx_http_mp4_update_mdat_atom(mp4, start_offset) - start_offset; |