Commit 497c9b0c authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/rtsp: Check number of streams in sdp_parse_line()

Fixes: OOM
Found-by: 's avatarMichael Hanselmann <public@hansmi.ch>
Reviewed-by: 's avatarMichael Hanselmann <public@hansmi.ch>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent a53c4f36
......@@ -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;
}
......
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