Welcome! Log In Create A New Profile

Advanced

[nginx] Mp4: fixed setting wrong mdat atom size in very rare cases.

Maxim Dounin
December 05, 2016 03:46PM
details: http://hg.nginx.org/nginx/rev/2b2239a1e0d4
branches:
changeset: 6818:2b2239a1e0d4
user: hucongcong <hucong.c@foxmail.com>
date: Tue Nov 22 13:40:08 2016 +0800
description:
Mp4: fixed setting wrong mdat atom size in very rare cases.

Atom size is the sum of atom header size and atom data size. The
specification says that the first 4 bytes are set to one when
the atom size is greater than the maximum unsigned 32-bit value.
Which means atom header size should be considered when the
comparison takes place between atom data size and 0xffffffff.

diffstat:

src/http/modules/ngx_http_mp4_module.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diffs (14 lines):

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
@@ -1229,7 +1229,9 @@ ngx_http_mp4_update_mdat_atom(ngx_http_m

atom_header = mp4->mdat_atom_header;

- if ((uint64_t) atom_data_size > (uint64_t) 0xffffffff) {
+ if ((uint64_t) atom_data_size
+ > (uint64_t) 0xffffffff - sizeof(ngx_mp4_atom_header_t))
+ {
atom_size = 1;
atom_header_size = sizeof(ngx_mp4_atom_header64_t);
ngx_mp4_set_64value(atom_header + sizeof(ngx_mp4_atom_header_t),
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Mp4: fixed setting wrong mdat atom size in very rare cases.

Maxim Dounin 513 December 05, 2016 03:46PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 157
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready