Browse Source

avformat/oggparsecelt/celt_header: fix memleak

Fixes: CID1108605
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
b294a4beec
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavformat/oggparsecelt.c

+ 3
- 1
libavformat/oggparsecelt.c View File

@@ -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 */


Loading…
Cancel
Save