Browse Source

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

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n0.11
Martin Storsjö 14 years ago
parent
commit
9294f538e9
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      libavformat/rtspdec.c

+ 3
- 2
libavformat/rtspdec.c View File

@@ -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…
Cancel
Save