Fixed null pointer dereference while reading AMF.

Thanks to Zengxian Ding.
This commit is contained in:
Roman Arutyunyan
2021-05-25 10:42:16 +03:00
parent 2f2db811f8
commit 23e1873aa6

View File

@ -328,7 +328,7 @@ ngx_rtmp_amf_read(ngx_rtmp_amf_ctx_t *ctx, ngx_rtmp_amf_elt_t *elts,
} else {
switch (ngx_rtmp_amf_get(ctx, &type8, 1)) {
case NGX_DONE:
if (elts->type & NGX_RTMP_AMF_OPTIONAL) {
if (elts && elts->type & NGX_RTMP_AMF_OPTIONAL) {
return NGX_OK;
}
/* fall through */