summaryrefslogtreecommitdiff
path: root/libavformat/oggparsecelt.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-20 16:38:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-10-20 16:48:51 +0200
commitb294a4beec24d07903c4aefb8ca26cc154fdd5ac (patch)
tree84cd30cb3556431ab09744a088366da63db688bd /libavformat/oggparsecelt.c
parentbaab248c499a7689aefb5f2e9c004338deb08d74 (diff)
avformat/oggparsecelt/celt_header: fix memleak
Fixes: CID1108605 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/oggparsecelt.c')
-rw-r--r--libavformat/oggparsecelt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/oggparsecelt.c b/libavformat/oggparsecelt.c
index 4b6233e0c7..f3c2c1a632 100644
--- a/libavformat/oggparsecelt.c
+++ b/libavformat/oggparsecelt.c
@@ -46,7 +46,9 @@ static int celt_header(AVFormatContext *s, int idx)
uint32_t overlap, extra_headers;
priv = av_malloc(sizeof(struct oggcelt_private));
- if (!priv || ff_alloc_extradata(st->codec, 2 * sizeof(uint32_t)))
+ if (!priv)
+ return AVERROR(ENOMEM);
+ if (ff_alloc_extradata(st->codec, 2 * sizeof(uint32_t)) < 0)
return AVERROR(ENOMEM);
version = AV_RL32(p + 28);
/* unused header size field skipped */