mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-09-30 00:30:24 +02:00
avformat/oggdec: Use av_realloc_array()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
3dc6e4d602
commit
26aa844a21
@ -251,7 +251,6 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial)
|
|||||||
int idx = ogg->nstreams;
|
int idx = ogg->nstreams;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
struct ogg_stream *os;
|
struct ogg_stream *os;
|
||||||
size_t size;
|
|
||||||
|
|
||||||
if (ogg->state) {
|
if (ogg->state) {
|
||||||
av_log(s, AV_LOG_ERROR, "New streams are not supposed to be added "
|
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 */
|
/* Allocate and init a new Ogg Stream */
|
||||||
if (av_size_mult(ogg->nstreams + 1, sizeof(*ogg->streams), &size) < 0 ||
|
if (!(os = av_realloc_array(ogg->streams, ogg->nstreams + 1,
|
||||||
!(os = av_realloc(ogg->streams, size)))
|
sizeof(*ogg->streams))))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
ogg->streams = os;
|
ogg->streams = os;
|
||||||
os = ogg->streams + idx;
|
os = ogg->streams + idx;
|
||||||
|
Loading…
Reference in New Issue
Block a user