aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-03-04 15:39:03 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2013-03-04 15:39:03 +0000
commitb502fcb37a1a8cd1a79d43d5f3d215a933c372d9 (patch)
treeb072ddad079373fad253a079db6805764d9a7707 /src
parentfcf003c6f4a5a7c885de0befcd45f4acddefb47b (diff)
downloadnginx-b502fcb37a1a8cd1a79d43d5f3d215a933c372d9.tar.gz
nginx-b502fcb37a1a8cd1a79d43d5f3d215a933c372d9.zip
Mp4: fixed handling of too small mdat atoms (ticket #266).
Patch by Gernot Vormayr (with minor changes).
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_mp4_module.c7
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 b864858ea..20ef51af2 100644
--- a/src/http/modules/ngx_http_mp4_module.c
+++ b/src/http/modules/ngx_http_mp4_module.c
@@ -754,6 +754,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;