diff options
author | Piotr Bandurski <ami_stuff@o2.pl> | 2013-07-09 19:29:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-09 19:41:22 +0200 |
commit | aa74810fc6b9afe21c9be3725e3d078d10633670 (patch) | |
tree | ac20c08e7cba1ae96120d247938b3bf58c2f89bc /libavcodec | |
parent | 193782216fc8179ec92d498449be0a51e4c7c658 (diff) | |
download | ffmpeg-aa74810fc6b9afe21c9be3725e3d078d10633670.tar.gz |
bitstream: fix a crash in case of oom
fixes ticket #2766
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/bitstream.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 23bea43ac7..bbd9491ca0 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -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); buf = av_malloc((nb_codes + 1) * sizeof(VLCcode)); + if (!buf) + return AVERROR(ENOMEM); av_assert0(symbols_size <= 2 || !symbols); j = 0; |