summaryrefslogtreecommitdiff
path: root/libavformat/rtspdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-08 20:55:02 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-08 20:55:11 +0200
commit5d6a40bc747da93bd4ee41a446c35fc60a399671 (patch)
tree613c91012a37b3646f1575955d6124ffc4fdefe7 /libavformat/rtspdec.c
parent4f043c8a119101ffe8f6a57b18a47f602a350c30 (diff)
parent9294f538e924dcb8f3938e4e3476340f1e5b552f (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtsp: Don't use av_malloc(0) if there are no streams rtsp: Don't use uninitialized data if there are no streams vaapi: mpeg2: fix slice_vertical_position calculation. hwaccel: mpeg2: decode first field, if requested. cosmetics: Fix indentation rtsp: Don't expose the MS-RTSP RTX data stream to the caller Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtspdec.c')
-rw-r--r--libavformat/rtspdec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index ea2d517e3c..9c7df96a8f 100644
--- 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;