aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2013-10-13 20:02:26 -0300
committerMichael Niedermayer <michaelni@gmx.at>2013-10-14 12:59:59 +0200
commitaae8975ffbb536f18df51e8f00eaa7b0117d16c9 (patch)
treea6d0151d3e3eed446a9c0974f970b042a38a0a73 /libavformat
parent8d9f08ef32f15678375847c4c21d208f8e9d1ebc (diff)
downloadffmpeg-aae8975ffbb536f18df51e8f00eaa7b0117d16c9.tar.gz
oggparseopus: use ff_alloc_extradata()
Signed-off-by: James Almer <jamrial@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/oggparseopus.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavformat/oggparseopus.c b/libavformat/oggparseopus.c
index da753263d0..78aa333187 100644
--- a/libavformat/oggparseopus.c
+++ b/libavformat/oggparseopus.c
@@ -41,7 +41,6 @@ static int opus_header(AVFormatContext *avf, int idx)
AVStream *st = avf->streams[idx];
struct oggopus_private *priv = os->private;
uint8_t *packet = os->buf + os->pstart;
- uint8_t *extradata;
if (!priv) {
priv = os->private = av_mallocz(sizeof(*priv));
@@ -60,13 +59,10 @@ static int opus_header(AVFormatContext *avf, int idx)
/*gain = AV_RL16(packet + 16);*/
/*channel_map = AV_RL8 (packet + 18);*/
- extradata = av_malloc(os->psize + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!extradata)
+ if (ff_alloc_extradata(st->codec, os->psize))
return AVERROR(ENOMEM);
- memcpy(extradata, packet, os->psize);
- st->codec->extradata = extradata;
- st->codec->extradata_size = os->psize;
+ memcpy(st->codec->extradata, packet, os->psize);
st->codec->sample_rate = 48000;
avpriv_set_pts_info(st, 64, 1, 48000);