aboutsummaryrefslogtreecommitdiff
path: root/libavformat/rdt.c
diff options
context:
space:
mode:
authorMichael Niedermayer2013-09-19 11:01:26 +0200
committerMichael Niedermayer2013-09-19 11:01:26 +0200
commit20dfab33f5ab61fc51de65192ed239f8b62782a2 (patch)
treef5164b3f79ab48e4dd4c027bef968666f7748716 /libavformat/rdt.c
parentf54d751f33375054d4ecf30301ef008c8e781f99 (diff)
parent5626f994f273af80fb100d4743b963304de9e05c (diff)
Merge commit '5626f994f273af80fb100d4743b963304de9e05c'
* commit '5626f994f273af80fb100d4743b963304de9e05c': avformat: Use av_reallocp() where suitable Conflicts: libavformat/avidec.c libavformat/avienc.c libavformat/aviobuf.c libavformat/oggparsevorbis.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 54111a5ada..e3de5cac63 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();