mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-04-18 16:40:23 +00:00
avformat/sctp: Check size in sctp_write()
Fixes: out of array access No testcase Found-by: Joshua Rogers <joshua@joshua.hu> with ZeroPath Reviewed-by: Joshua Rogers <joshua@joshua.hu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
83e0298de2
commit
5b98cea4bf
1 changed files with 3 additions and 0 deletions
|
|
@ -332,6 +332,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue