mirror of https://git.ffmpeg.org/ffmpeg.git
rtsp: Don't use av_malloc(0) if there are no streams
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
62c3c8ca78
commit
9294f538e9
|
@ -159,8 +159,9 @@ static int rtsp_read_header(AVFormatContext *s)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
rt->real_setup_cache = av_mallocz(2 * s->nb_streams * sizeof(*rt->real_setup_cache));
|
rt->real_setup_cache = !s->nb_streams ? NULL :
|
||||||
if (!rt->real_setup_cache)
|
av_mallocz(2 * s->nb_streams * sizeof(*rt->real_setup_cache));
|
||||||
|
if (!rt->real_setup_cache && s->nb_streams)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
rt->real_setup = rt->real_setup_cache + s->nb_streams;
|
rt->real_setup = rt->real_setup_cache + s->nb_streams;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue