diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-22 21:25:58 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-22 21:27:09 +0100 |
commit | 2234a1cd16680df7e15f5b8c44c3caadd22f5d25 (patch) | |
tree | 8f22f2448abcff24e080b255dff30c91af9427d0 | |
parent | 8559a714155a7bc79d4802558f509e211379a8a0 (diff) | |
download | ffmpeg-2234a1cd16680df7e15f5b8c44c3caadd22f5d25.tar.gz |
avcodec/vorbisdec: Fix memleak, call cleanup on memory allocation failure
Fixes CID1258478, CID1258476, CID1258475
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/vorbisdec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index d05a48a744..35eb2be0e1 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -383,8 +383,10 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) codebook_setup->codevectors = av_mallocz_array(used_entries, codebook_setup->dimensions * sizeof(*codebook_setup->codevectors)); - if (!codebook_setup->codevectors) - return AVERROR(ENOMEM); + if (!codebook_setup->codevectors) { + ret = AVERROR(ENOMEM); + goto error; + } } else codebook_setup->codevectors = NULL; |