git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62c3c8c
)
rtsp: Don't use av_malloc(0) if there are no streams
author
Martin Storsjö
<martin@martin.st>
Fri, 6 Apr 2012 19:36:16 +0000
(22:36 +0300)
committer
Martin Storsjö
<martin@martin.st>
Sun, 8 Apr 2012 12:51:33 +0000
(15:51 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtspdec.c
patch
|
blob
|
history
diff --git
a/libavformat/rtspdec.c
b/libavformat/rtspdec.c
index
9306384
..
063e825
100644
(file)
--- a/
libavformat/rtspdec.c
+++ b/
libavformat/rtspdec.c
@@
-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;