fixed buffer allocation when broadcasting

This commit is contained in:
Roman Arutyunyan 2012-03-14 10:22:27 +04:00
parent 68c64116b2
commit eaef3b90b9
2 changed files with 6 additions and 4 deletions

2
TODO
View file

@ -11,6 +11,8 @@
- closing session on send error
causes crash because of double-freeing stack
- add max message size
- recognize amf-meta
- shortcuts for big-endian copy

View file

@ -227,7 +227,7 @@ ngx_rtmp_broadcast_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
ngx_rtmp_broadcast_ctx_t *ctx, *cctx;
ngx_chain_t *out, *l, **ll;
u_char *p;
size_t nsubs;
size_t nsubs, size;
c = s->connection;
@ -267,9 +267,9 @@ ngx_rtmp_broadcast_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
p = in->buf->pos;
}
l->buf->last = ngx_cpymem(l->buf->last, p,
l->buf->end - l->buf->last);
p += (l->buf->end - l->buf->last);
size = l->buf->end - l->buf->last;
l->buf->last = ngx_cpymem(l->buf->last, p, size);
p += size;
}
done: