diff --git a/libavformat/sctp.c b/libavformat/sctp.c index 9d9e90097e..f39ba7ebe0 100644 --- a/libavformat/sctp.c +++ b/libavformat/sctp.c @@ -334,6 +334,9 @@ static int sctp_write(URLContext *h, const uint8_t *buf, int size) } if (s->max_streams) { + if (size < 2) + return AVERROR(EINVAL); + /*StreamId is introduced as a 2byte code into the stream*/ struct sctp_sndrcvinfo info = { 0 }; info.sinfo_stream = AV_RB16(buf);