avformat/rtsp: allocate correct max number of pollfds

There is one general rtsp connection plus two connections per stream (rtp/rtcp).

Reviewed-by: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
This commit is contained in:
Andriy Gelman 2020-09-26 18:26:30 -04:00
parent b4103e0eb6
commit 0d156eb58a
1 changed files with 1 additions and 1 deletions

View File

@ -1990,7 +1990,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
int *fds = NULL, fdsnum, fdsidx;
if (!p) {
p = rt->p = av_malloc_array(2 * (rt->nb_rtsp_streams + 1), sizeof(struct pollfd));
p = rt->p = av_malloc_array(2 * rt->nb_rtsp_streams + 1, sizeof(struct pollfd));
if (!p)
return AVERROR(ENOMEM);