obs-outputs: Properly reset stream count on RTMP_Close
Every addStream call would increment this counter. After merging the mbedTLS fixes, we no longer have extraneous RTMP_Init calls which were masking the prescence of this bug. This caused every stream after the first stream to have the wrong channel index, and eventually OBS would crash due to an out of bounds write if the counter reached RTMP_MAX_STREAMS.
This commit is contained in:
parent
28cdebdc9e
commit
ee4cbb1199
@ -4361,11 +4361,11 @@ RTMP_Close(RTMP *r)
|
||||
free(r->Link.streams[idx].playpath.av_val);
|
||||
r->Link.streams[idx].playpath.av_val = NULL;
|
||||
}
|
||||
|
||||
r->Link.curStreamIdx = 0;
|
||||
r->Link.nStreams = 0;
|
||||
}
|
||||
|
||||
r->Link.curStreamIdx = 0;
|
||||
r->Link.nStreams = 0;
|
||||
|
||||
if ((r->Link.protocol & RTMP_FEATURE_WRITE) &&
|
||||
(r->Link.pFlags & RTMP_PUB_CLEAN) &&
|
||||
(r->Link.pFlags & RTMP_PUB_ALLOC))
|
||||
|
@ -407,6 +407,8 @@ static int send_packet(struct rtmp_stream *stream,
|
||||
int recv_size = 0;
|
||||
int ret = 0;
|
||||
|
||||
assert(idx < RTMP_MAX_STREAMS);
|
||||
|
||||
if (!stream->new_socket_loop) {
|
||||
#ifdef _WIN32
|
||||
ret = ioctlsocket(stream->rtmp.m_sb.sb_socket, FIONREAD,
|
||||
|
Loading…
x
Reference in New Issue
Block a user