mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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)
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user