Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
8ea1459b
Commit
8ea1459b
authored
Jul 26, 2012
by
Samuel Pitoiset
Committed by
Martin Storsjö
Jul 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtmp: Check the buffer length of ping packets
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
e49e6b64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
rtmpproto.c
libavformat/rtmpproto.c
+12
-0
No files found.
libavformat/rtmpproto.c
View file @
8ea1459b
...
@@ -515,6 +515,12 @@ static int gen_pong(URLContext *s, RTMPContext *rt, RTMPPacket *ppkt)
...
@@ -515,6 +515,12 @@ static int gen_pong(URLContext *s, RTMPContext *rt, RTMPPacket *ppkt)
uint8_t
*
p
;
uint8_t
*
p
;
int
ret
;
int
ret
;
if
(
ppkt
->
data_size
<
6
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Too short ping packet (%d)
\n
"
,
ppkt
->
data_size
);
return
AVERROR_INVALIDDATA
;
}
if
((
ret
=
ff_rtmp_packet_create
(
&
pkt
,
RTMP_NETWORK_CHANNEL
,
RTMP_PT_PING
,
if
((
ret
=
ff_rtmp_packet_create
(
&
pkt
,
RTMP_NETWORK_CHANNEL
,
RTMP_PT_PING
,
ppkt
->
timestamp
+
1
,
6
))
<
0
)
ppkt
->
timestamp
+
1
,
6
))
<
0
)
return
ret
;
return
ret
;
...
@@ -913,6 +919,12 @@ static int handle_ping(URLContext *s, RTMPPacket *pkt)
...
@@ -913,6 +919,12 @@ static int handle_ping(URLContext *s, RTMPPacket *pkt)
RTMPContext
*
rt
=
s
->
priv_data
;
RTMPContext
*
rt
=
s
->
priv_data
;
int
t
,
ret
;
int
t
,
ret
;
if
(
pkt
->
data_size
<
2
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Too short ping packet (%d)
\n
"
,
pkt
->
data_size
);
return
AVERROR_INVALIDDATA
;
}
t
=
AV_RB16
(
pkt
->
data
);
t
=
AV_RB16
(
pkt
->
data
);
if
(
t
==
6
)
{
if
(
t
==
6
)
{
if
((
ret
=
gen_pong
(
s
,
rt
,
pkt
))
<
0
)
if
((
ret
=
gen_pong
(
s
,
rt
,
pkt
))
<
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment