You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
bitstream: fix a crash in case of oom
fixes ticket #2766 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
193782216f
commit
aa74810fc6
@@ -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;
|
||||||
|
Reference in New Issue
Block a user