Commit 9294f538 authored by Martin Storsjö's avatar Martin Storsjö

rtsp: Don't use av_malloc(0) if there are no streams

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 62c3c8ca
......@@ -159,8 +159,9 @@ static int rtsp_read_header(AVFormatContext *s)
if (ret)
return ret;
rt->real_setup_cache = av_mallocz(2 * s->nb_streams * sizeof(*rt->real_setup_cache));
if (!rt->real_setup_cache)
rt->real_setup_cache = !s->nb_streams ? NULL :
av_mallocz(2 * s->nb_streams * sizeof(*rt->real_setup_cache));
if (!rt->real_setup_cache && s->nb_streams)
return AVERROR(ENOMEM);
rt->real_setup = rt->real_setup_cache + s->nb_streams;
......
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