Skip to content

Commit

Permalink
[fix] refactored (#245) and fixed a compilation error on Mac (#246).
Browse files Browse the repository at this point in the history
  • Loading branch information
winshining committed Sep 29, 2023
1 parent d978ffe commit 3274d53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions ngx_rtmp_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ ngx_rtmp_prepare_message(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,

hsize = hdrsize[fmt];

(void) nbufs;
ngx_log_debug8(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"RTMP prep %s (%d) fmt=%d csid=%uD timestamp=%uD "
"mlen=%uD msid=%uD nbufs=%d",
Expand Down
5 changes: 3 additions & 2 deletions ngx_rtmp_receive.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,15 @@ ngx_rtmp_amf_message_handler(ngx_rtmp_session_t *s,

while (cl) {
amf_len += cl->buf->last - cl->buf->pos;
if (amf_len >= 8) {
/* type: 1B, number payload: 8B */
if (amf_len >= 9) {
break;
}

cl = cl->next;
}

if (amf_len < 8) {
if (amf_len < 9) {
ngx_log_error(NGX_LOG_WARN, s->connection->log, 0,
"AMF malformed: type=%d, length=%D, ignored",
NGX_RTMP_AMF_NUMBER, amf_len);
Expand Down

0 comments on commit 3274d53

Please sign in to comment.