summaryrefslogtreecommitdiff
path: root/libavformat/ape.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/ape.c')
-rw-r--r--libavformat/ape.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c
index 7ed9dd813b..613a59d5f8 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -354,8 +354,8 @@ static int ape_read_header(AVFormatContext * s)
st->duration = total_blocks;
avpriv_set_pts_info(st, 64, 1, ape->samplerate);
- st->codec->extradata = av_malloc(APE_EXTRADATA_SIZE);
- st->codec->extradata_size = APE_EXTRADATA_SIZE;
+ if (ff_alloc_extradata(st->codec, APE_EXTRADATA_SIZE))
+ return AVERROR(ENOMEM);
AV_WL16(st->codec->extradata + 0, ape->fileversion);
AV_WL16(st->codec->extradata + 2, ape->compressiontype);
AV_WL16(st->codec->extradata + 4, ape->formatflags);