projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7748dd4
)
rtpproto: Check the size before reading buf[1]
author
Martin Storsjö
<martin@martin.st>
Wed, 31 Jul 2013 09:45:33 +0000
(12:45 +0300)
committer
Martin Storsjö
<martin@martin.st>
Thu, 1 Aug 2013 06:41:21 +0000
(09:41 +0300)
I doubt that anyone ever would try to send a 1 byte packet
via the RTP protocol, but check just in case - it shouldn't
crash at least.
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtpproto.c
patch
|
blob
|
history
diff --git
a/libavformat/rtpproto.c
b/libavformat/rtpproto.c
index
4e177b9
..
b21c121
100644
(file)
--- a/
libavformat/rtpproto.c
+++ b/
libavformat/rtpproto.c
@@
-368,6
+368,9
@@
static int rtp_write(URLContext *h, const uint8_t *buf, int size)
int ret;
URLContext *hd;
+ if (size < 2)
+ return AVERROR(EINVAL);
+
if (RTP_PT_IS_RTCP(buf[1])) {
/* RTCP payload type */
hd = s->rtcp_hd;