Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

object & mixed_array are now compatible

  • Loading branch information...
commit 9a21b694afaa252bff80c441f706cf5793cc4b48 1 parent 3152e03
@arut authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 ngx_rtmp_amf.c
View
12 ngx_rtmp_amf.c
@@ -250,6 +250,15 @@ ngx_rtmp_amf_read_array(ngx_rtmp_amf_ctx_t *ctx, ngx_rtmp_amf_elt_t *elts,
}
+static ngx_int_t
+ngx_rtmp_amf_is_compatible_type(uint8_t t1, uint8_t t2)
+{
+ return t1 == t2
+ || (t1 == NGX_RTMP_AMF_OBJECT && t2 == NGX_RTMP_AMF_MIXED_ARRAY)
+ || (t2 == NGX_RTMP_AMF_OBJECT && t1 == NGX_RTMP_AMF_MIXED_ARRAY);
+}
+
+
ngx_int_t
ngx_rtmp_amf_read(ngx_rtmp_amf_ctx_t *ctx, ngx_rtmp_amf_elt_t *elts,
size_t nelts)
@@ -279,7 +288,8 @@ ngx_rtmp_amf_read(ngx_rtmp_amf_ctx_t *ctx, ngx_rtmp_amf_elt_t *elts,
return NGX_ERROR;
}
type = type8;
- data = (elts && (elts->type & 0xff) == type)
+ data = (elts &&
+ ngx_rtmp_amf_is_compatible_type(elts->type & 0xff, type))
? elts->data
: NULL;
}
Please sign in to comment.
Something went wrong with that request. Please try again.