diff --git a/ngx_rtmp_amf.c b/ngx_rtmp_amf.c index b20989c..3fe3ccf 100644 --- a/ngx_rtmp_amf.c +++ b/ngx_rtmp_amf.c @@ -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 */