diff options
author | Alexandra Khirnova <alexandra.khirnova@gmail.com> | 2013-09-10 11:57:35 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-09-10 12:38:32 +0200 |
commit | f369b9356c4606cd4d713d60f7db5de119d901fa (patch) | |
tree | 174e199dd9716a32fbee4fb235d3938721fb333f /libavformat/mpegts.c | |
parent | bdf990425e2be6912a6d29f032ca558448c8635a (diff) | |
download | ffmpeg-f369b9356c4606cd4d713d60f7db5de119d901fa.tar.gz |
avformat: Use av_reallocp_array() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r-- | libavformat/mpegts.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index ba41f7fbd9..d623452130 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -201,10 +201,10 @@ static void clear_programs(MpegTSContext *ts) static void add_pat_entry(MpegTSContext *ts, unsigned int programid) { struct Program *p; - void *tmp = av_realloc(ts->prg, (ts->nb_prg+1)*sizeof(struct Program)); - if(!tmp) + if (av_reallocp_array(&ts->prg, ts->nb_prg + 1, sizeof(*ts->prg)) < 0) { + ts->nb_prg = 0; return; - ts->prg = tmp; + } p = &ts->prg[ts->nb_prg]; p->id = programid; p->nb_pids = 0; |