1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '31dc73e92a96f08d07650c0e7d31c0b9a1465d46'

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

Conflicts:
	libavcodec/vorbisdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-02-17 22:39:32 +01:00
commit 7a7b77e6c9

View File

@ -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;