Commit 7a7b77e6 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '31dc73e9'

* commit '31dc73e9':
  vorbisdec: Check memory allocations

Conflicts:
	libavcodec/vorbisdec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 3d5c0ba8 31dc73e9
......@@ -379,10 +379,15 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
}
// Weed out unused vlcs and build codevector vector
codebook_setup->codevectors = used_entries ? av_mallocz_array(used_entries,
codebook_setup->dimensions *
sizeof(*codebook_setup->codevectors))
: NULL;
if (used_entries) {
codebook_setup->codevectors =
av_mallocz_array(used_entries, codebook_setup->dimensions *
sizeof(*codebook_setup->codevectors));
if (!codebook_setup->codevectors)
return AVERROR(ENOMEM);
} else
codebook_setup->codevectors = NULL;
for (j = 0, i = 0; i < entries; ++i) {
unsigned dim = codebook_setup->dimensions;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment