diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-01-25 21:30:04 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-01-31 17:33:50 +0100 |
commit | 497c9b0cce559d43607bbbd679fe42f1d7e9040e (patch) | |
tree | 5b9518debb3e18f7908936d8ae1de82786d2b116 /libavformat/rtsp.c | |
parent | a53c4f3689996f6090078f36de32bce1744f395b (diff) | |
download | ffmpeg-497c9b0cce559d43607bbbd679fe42f1d7e9040e.tar.gz |
avformat/rtsp: Check number of streams in sdp_parse_line()
Fixes: OOM
Found-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Michael Hanselmann <public@hansmi.ch>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 82c6c12af5..975637cf54 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -454,7 +454,10 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, } else if (!strcmp(st_type, "text")) { codec_type = AVMEDIA_TYPE_SUBTITLE; } - if (codec_type == AVMEDIA_TYPE_UNKNOWN || !(rt->media_type_mask & (1 << codec_type))) { + if (codec_type == AVMEDIA_TYPE_UNKNOWN || + !(rt->media_type_mask & (1 << codec_type)) || + rt->nb_rtsp_streams >= s->max_streams + ) { s1->skip_media = 1; return; } |