aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bitstream.c
diff options
context:
space:
mode:
authorPiotr Bandurski <ami_stuff@o2.pl>2013-07-09 19:29:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-09 19:41:22 +0200
commitaa74810fc6b9afe21c9be3725e3d078d10633670 (patch)
treeac20c08e7cba1ae96120d247938b3bf58c2f89bc /libavcodec/bitstream.c
parent193782216fc8179ec92d498449be0a51e4c7c658 (diff)
downloadffmpeg-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/bitstream.c')
-rw-r--r--libavcodec/bitstream.c2
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;