mirror of https://github.com/FFmpeg/FFmpeg.git
Compare commits
3 Commits
fa959bb135
...
5b98cea4bf
| Author | SHA1 | Date |
|---|---|---|
|
|
5b98cea4bf | |
|
|
83e0298de2 | |
|
|
a64e037429 |
|
|
@ -163,6 +163,13 @@ static int handle_chunk_size(URLContext *s, RTMPPacket *pkt);
|
||||||
static int handle_window_ack_size(URLContext *s, RTMPPacket *pkt);
|
static int handle_window_ack_size(URLContext *s, RTMPPacket *pkt);
|
||||||
static int handle_set_peer_bw(URLContext *s, RTMPPacket *pkt);
|
static int handle_set_peer_bw(URLContext *s, RTMPPacket *pkt);
|
||||||
|
|
||||||
|
static size_t zstrlen(const char *c)
|
||||||
|
{
|
||||||
|
if(c)
|
||||||
|
return strlen(c);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int add_tracked_method(RTMPContext *rt, const char *name, int id)
|
static int add_tracked_method(RTMPContext *rt, const char *name, int id)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
@ -327,7 +334,16 @@ static int gen_connect(URLContext *s, RTMPContext *rt)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
|
if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
|
||||||
0, 4096 + APP_MAX_LENGTH)) < 0)
|
0, 4096 + APP_MAX_LENGTH
|
||||||
|
+ strlen(rt->auth_params) + strlen(rt->flashver)
|
||||||
|
+ zstrlen(rt->enhanced_codecs)/5*7
|
||||||
|
+ zstrlen(rt->swfurl)
|
||||||
|
+ zstrlen(rt->swfverify)
|
||||||
|
+ zstrlen(rt->tcurl)
|
||||||
|
+ zstrlen(rt->auth_params)
|
||||||
|
+ zstrlen(rt->pageurl)
|
||||||
|
+ zstrlen(rt->conn)*3
|
||||||
|
)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
p = pkt.data;
|
p = pkt.data;
|
||||||
|
|
@ -1926,7 +1942,9 @@ static int write_status(URLContext *s, RTMPPacket *pkt,
|
||||||
|
|
||||||
if ((ret = ff_rtmp_packet_create(&spkt, RTMP_SYSTEM_CHANNEL,
|
if ((ret = ff_rtmp_packet_create(&spkt, RTMP_SYSTEM_CHANNEL,
|
||||||
RTMP_PT_INVOKE, 0,
|
RTMP_PT_INVOKE, 0,
|
||||||
RTMP_PKTDATA_DEFAULT_SIZE)) < 0) {
|
RTMP_PKTDATA_DEFAULT_SIZE
|
||||||
|
+ strlen(status) + strlen(description)
|
||||||
|
+ zstrlen(details))) < 0) {
|
||||||
av_log(s, AV_LOG_ERROR, "Unable to create response packet\n");
|
av_log(s, AV_LOG_ERROR, "Unable to create response packet\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -2859,6 +2877,12 @@ reconnect:
|
||||||
"FMLE/3.0 (compatible; %s)", LIBAVFORMAT_IDENT);
|
"FMLE/3.0 (compatible; %s)", LIBAVFORMAT_IDENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( strlen(rt->flashver) > FLASHVER_MAX_LENGTH
|
||||||
|
|| strlen(rt->tcurl ) > TCURL_MAX_LENGTH
|
||||||
|
) {
|
||||||
|
ret = AVERROR(EINVAL);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
rt->receive_report_size = 1048576;
|
rt->receive_report_size = 1048576;
|
||||||
rt->bytes_read = 0;
|
rt->bytes_read = 0;
|
||||||
|
|
|
||||||
|
|
@ -332,6 +332,9 @@ static int sctp_write(URLContext *h, const uint8_t *buf, int size)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->max_streams) {
|
if (s->max_streams) {
|
||||||
|
if (size < 2)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
/*StreamId is introduced as a 2byte code into the stream*/
|
/*StreamId is introduced as a 2byte code into the stream*/
|
||||||
struct sctp_sndrcvinfo info = { 0 };
|
struct sctp_sndrcvinfo info = { 0 };
|
||||||
info.sinfo_stream = AV_RB16(buf);
|
info.sinfo_stream = AV_RB16(buf);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue