Fixes: OOM
Found-by: Michael Hanselmann <[email protected]>
Reviewed-by: Michael Hanselmann <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
---
libavformat/rtsp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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;
}
--
2.20.1
_______________________________________________
ffmpeg-devel mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel