summaryrefslogtreecommitdiff
path: root/libavformat/rdt.c
diff options
context:
space:
mode:
authorAlexandra Khirnova <alexandra.khirnova@gmail.com>2013-09-18 18:12:36 +0200
committerDiego Biurrun <diego@biurrun.de>2013-09-18 18:28:38 +0200
commit5626f994f273af80fb100d4743b963304de9e05c (patch)
tree69a48a5383a83d06f8e25df3098cce219788e873 /libavformat/rdt.c
parent0f310a6f333b016d336674d086045e8473fdf918 (diff)
avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/rdt.c')
-rw-r--r--libavformat/rdt.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index a8367e51ca..d691ae904f 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -419,15 +419,14 @@ rdt_parse_sdp_line (AVFormatContext *s, int st_index,
for (n = 0; n < s->nb_streams; n++)
if (s->streams[n]->id == stream->id) {
- int count = s->streams[n]->index + 1;
+ int count = s->streams[n]->index + 1, err;
if (first == -1) first = n;
if (rdt->nb_rmst < count) {
- RMStream **rmst= av_realloc(rdt->rmst, count*sizeof(*rmst));
- if (!rmst)
- return AVERROR(ENOMEM);
- memset(rmst + rdt->nb_rmst, 0,
- (count - rdt->nb_rmst) * sizeof(*rmst));
- rdt->rmst = rmst;
+ if ((err = av_reallocp(&rdt->rmst,
+ count * sizeof(*rdt->rmst))) < 0)
+ return err;
+ memset(rdt->rmst + rdt->nb_rmst, 0,
+ (count - rdt->nb_rmst) * sizeof(*rdt->rmst));
rdt->nb_rmst = count;
}
rdt->rmst[s->streams[n]->index] = ff_rm_alloc_rmstream();