aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-10 19:36:00 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-12 15:25:58 +0200
commit26aa844a214388b775839cc1ae06c97e695b464a (patch)
tree9b77bc3e79897872829cdaa3d19b0ec12dec4835 /libavformat
parent3dc6e4d60243cc32e6d2e17ad6e19db531d39fbc (diff)
downloadffmpeg-26aa844a214388b775839cc1ae06c97e695b464a.tar.gz
avformat/oggdec: Use av_realloc_array()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/oggdec.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index bb289e0756..5afbae2147 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -251,7 +251,6 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial)
int idx = ogg->nstreams;
AVStream *st;
struct ogg_stream *os;
- size_t size;
if (ogg->state) {
av_log(s, AV_LOG_ERROR, "New streams are not supposed to be added "
@@ -260,8 +259,8 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial)
}
/* Allocate and init a new Ogg Stream */
- if (av_size_mult(ogg->nstreams + 1, sizeof(*ogg->streams), &size) < 0 ||
- !(os = av_realloc(ogg->streams, size)))
+ if (!(os = av_realloc_array(ogg->streams, ogg->nstreams + 1,
+ sizeof(*ogg->streams))))
return AVERROR(ENOMEM);
ogg->streams = os;
os = ogg->streams + idx;