Mp4: avoid adding or comparing to null pointer

It is considered undefined behavior.

Reported by Geonwoo.kim (awo@kakao.com).
This commit is contained in:
Roman Arutyunyan authored and Roman Arutyunyan committed 2026-05-15 16:20:30 +04:00
1 parent 7d76d67241
commit 18a70a4d58
1 file changed
+3 -1
+3 -1
View File
@@ -1063,7 +1063,9 @@ ngx_http_mp4_read(ngx_http_mp4_file_t *mp4, size_t size)
{
ssize_t n;
if (mp4->buffer_pos + size <= mp4->buffer_end) {
if (mp4->buffer_pos && mp4->buffer_end
&& mp4->buffer_pos + size <= mp4->buffer_end)
{
return NGX_OK;
}