[FFmpeg-cvslog] avcodec/vorbisdec: Fix memleak, call cleanup on memory allocation failure
Michael Niedermayer
git at videolan.org
Sun Feb 22 22:13:32 CET 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 22 21:25:58 2015 +0100| [2234a1cd16680df7e15f5b8c44c3caadd22f5d25] | committer: Michael Niedermayer
avcodec/vorbisdec: Fix memleak, call cleanup on memory allocation failure
Fixes CID1258478, CID1258476, CID1258475
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2234a1cd16680df7e15f5b8c44c3caadd22f5d25
---
libavcodec/vorbisdec.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index d05a48a..35eb2be 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;
More information about the ffmpeg-cvslog
mailing list