diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-11-27 10:50:47 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-12-03 16:07:02 +0100 |
commit | a4798a5d5109cd9c1b5682efe19660e825da97e6 (patch) | |
tree | c91e38e738cf12d468e06aaba77738173eed75e1 /libavformat/oggparsevorbis.c | |
parent | b574fb472ed168f5a75cd981c98dd34cfe57ff3a (diff) |
all: Use av_memdup() where appropriate
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/oggparsevorbis.c')
-rw-r--r-- | libavformat/oggparsevorbis.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 77e8d301b2..e1ef510892 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -320,10 +320,9 @@ static int vorbis_header(AVFormatContext *s, int idx) return priv->vp ? 0 : AVERROR_INVALIDDATA; priv->len[pkt_type >> 1] = os->psize; - priv->packet[pkt_type >> 1] = av_mallocz(os->psize); + priv->packet[pkt_type >> 1] = av_memdup(os->buf + os->pstart, os->psize); if (!priv->packet[pkt_type >> 1]) return AVERROR(ENOMEM); - memcpy(priv->packet[pkt_type >> 1], os->buf + os->pstart, os->psize); if (os->buf[os->pstart] == 1) { const uint8_t *p = os->buf + os->pstart + 7; /* skip "\001vorbis" tag */ unsigned blocksize, bs0, bs1; |