<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 12, 2019, at 7:06 PM, winshining <<a href="mailto:winshining@163.com" class="">winshining@163.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="line-height: 1.7; font-size: 14px; font-family: Arial;" class=""><div class="">Hi, balus<br class="">I think the second parameter of ngx_http_flv_read in ngx_http_flv_read_metadata and ngx_http_flv_read_tags is incorrect, it should be NGX_FLV_TAG_HEADER_SIZE.<br class="">Besides, 'keyframes' is a non-standard object in metadata, there is no description about it in official tech document, you can refer to <a href="https://www.adobe.com/devnet/f4v.html" _src="https://www.adobe.com/devnet/f4v.html" class="">https://www.adobe.com/devnet/f4v.html</a> for details. Therefore, if a FLV file without the 'keyframes' object in metadata is played, the member 'times' of structure ngx_http_flv_file_t will be NULL, ngx_http_flv_timestamp_to_offset will crash then.<br class=""></div><div style="position:relative;zoom:1" class=""></div><div id="divNeteaseMailCard" class=""></div>
</div><br class=""><br class=""><span title="neteasefooter" class=""><div class=""> <br class="webkit-block-placeholder"></div></span>_______________________________________________<br class="">nginx-devel mailing list<br class=""><a href="mailto:nginx-devel@nginx.org" class="">nginx-devel@nginx.org</a><br class="">http://mailman.nginx.org/mailman/listinfo/nginx-devel</div></blockquote></div><br class=""><div class=""><br class=""></div><div class=""><div class="">Thanks for reading my code!</div><div class=""><br class=""></div><div class="">The first problem is a little confusing indeed. Notice that</div><div class="">NGX_FLV_HEADER_SIZE == NGX_FLV_TAG_HEADER_SIZE + NGX_FLV_PREV_TAG_SIZE,</div><div class="">and when I read a tag, I actually read tag_header + tag_data + prev_tag_size,</div><div class="">thus NGX_FLV_HEADER_SIZE is just what I need. Anyway, this is my fault, I</div><div class="">should have unified the two macros.</div><div class=""><br class=""></div><div class="">The second probelm has been carefully considered in the code. If there is no</div><div class="">‘keyframes’ object found in metadata, ngx_http_flv_parse_metadata() will return</div><div class="">NGX_DECLINED, which means to send the whole file, and therefore</div><div class="">ngx_http_flv_timestamp_to_offset() won’t be called and thus won’t crash.</div></div><div class=""><br class=""></div></body></html>