Commit 2e59142f authored by Michael Niedermayer's avatar Michael Niedermayer

sctp: dont abort on invalid input

Fixes Ticket1865
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d28dfa2d
......@@ -296,8 +296,10 @@ static int sctp_write(URLContext *h, const uint8_t *buf, int size)
/*StreamId is introduced as a 2byte code into the stream*/
struct sctp_sndrcvinfo info = { 0 };
info.sinfo_stream = AV_RB16(buf);
if (info.sinfo_stream > s->max_streams)
abort();
if (info.sinfo_stream > s->max_streams) {
av_log(h, AV_LOG_ERROR, "bad input data\n");
return AVERROR(EINVAL);
}
ret = ff_sctp_send(s->fd, buf + 2, size - 2, &info, MSG_EOR);
} else
ret = send(s->fd, buf, size, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment