[bugfix] Mp4: fixed start time is out mp4 mdat atom.

Maxim Dounin mdounin at mdounin.ru
Mon Mar 27 15:39:11 UTC 2017


Hello!

On Mon, Mar 27, 2017 at 10:57:51PM +0800, 胡聪 (hucc) wrote:

> # HG changeset patch
> # User hucongcong <hucong.c at foxmail.com>
> # Date 1490619789 -28800
> #      Mon Mar 27 21:03:09 2017 +0800
> # Node ID 67ad0b01f77ea5590d390b4b38d71ec2c739d333
> # Parent  22be63bf21edaa1b8ea916c7d8cd4e5fe4892061
> Mp4: fixed start time is out mp4 mdat atom.
> 
> start time is already out mp4 mdat atom when start_offset is equal to
> file_last of mdat.
> 
> diff -r 22be63bf21ed -r 67ad0b01f77e src/http/modules/ngx_http_mp4_module.c
> --- a/src/http/modules/ngx_http_mp4_module.c	Fri Mar 24 18:05:06 2017 +0300
> +++ b/src/http/modules/ngx_http_mp4_module.c	Mon Mar 27 21:03:09 2017 +0800
> @@ -860,7 +860,7 @@ ngx_http_mp4_process(ngx_http_mp4_file_t
> 
>      *prev = &mp4->mdat_atom;
> 
> -    if (start_offset > mp4->mdat_data.buf->file_last) {
> +    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);

Please explain what exactly you are trying to fix here.

If start_offset == file_last, the file can still contain a 
zero-sized mdat atom.  Such atom is unlikely to be usable, but it 
looks still legitimate from formal point of view.

-- 
Maxim Dounin
http://nginx.org/


More information about the nginx-devel mailing list