bitstream: fix a crash in case of oom

fixes ticket #2766

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Piotr Bandurski 2013-07-09 19:29:26 +02:00 committed by Michael Niedermayer
parent 193782216f
commit aa74810fc6
1 changed files with 2 additions and 0 deletions

View File

@ -299,6 +299,8 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
av_dlog(NULL, "build table nb_codes=%d\n", nb_codes); av_dlog(NULL, "build table nb_codes=%d\n", nb_codes);
buf = av_malloc((nb_codes + 1) * sizeof(VLCcode)); buf = av_malloc((nb_codes + 1) * sizeof(VLCcode));
if (!buf)
return AVERROR(ENOMEM);
av_assert0(symbols_size <= 2 || !symbols); av_assert0(symbols_size <= 2 || !symbols);
j = 0; j = 0;