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 - closing session on send error
causes crash because of double-freeing stack causes crash because of double-freeing stack
- add max message size
- recognize amf-meta - recognize amf-meta
- shortcuts for big-endian copy - 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_rtmp_broadcast_ctx_t *ctx, *cctx;
ngx_chain_t *out, *l, **ll; ngx_chain_t *out, *l, **ll;
u_char *p; u_char *p;
size_t nsubs; size_t nsubs, size;
c = s->connection; 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; p = in->buf->pos;
} }
l->buf->last = ngx_cpymem(l->buf->last, p, size = l->buf->end - l->buf->last;
l->buf->end - l->buf->last); l->buf->last = ngx_cpymem(l->buf->last, p, size);
p += (l->buf->end - l->buf->last); p += size;
} }
done: done: