[FFmpeg-cvslog] sctp: dont abort on invalid input
Michael Niedermayer
git at videolan.org
Mon Dec 17 02:12:54 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Dec 17 01:53:35 2012 +0100| [2e59142fa9a0db5fab8aa2e676ba524f61280b83] | committer: Michael Niedermayer
sctp: dont abort on invalid input
Fixes Ticket1865
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e59142fa9a0db5fab8aa2e676ba524f61280b83
---
libavformat/sctp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavformat/sctp.c b/libavformat/sctp.c
index 7fbc11f..2fd5400 100644
--- a/libavformat/sctp.c
+++ b/libavformat/sctp.c
@@ -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);
More information about the ffmpeg-cvslog
mailing list