This check is used to make things more consistent because we already
do this test for client bandwidth packets.
---
libavformat/rtmpproto.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index a2efe38..8d388ab 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -950,6 +950,13 @@ static int handle_server_bw(URLContext *s, RTMPPacket *pkt)
{
RTMPContext *rt = s->priv_data;
+ if (pkt->data_size < 4) {
+ av_log(s, AV_LOG_ERROR,
+ "Server bandwidth report packet is less than 4 bytes long
(%d)\n",
+ pkt->data_size);
+ return AVERROR_INVALIDDATA;
+ }
+
rt->server_bw = AV_RB32(pkt->data);
if (rt->server_bw <= 0) {
av_log(s, AV_LOG_ERROR, "Incorrect server bandwidth %d\n",
--
1.7.11.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel