summaryrefslogtreecommitdiff
path: root/libavcodec/bitstream.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-10-15 14:34:55 +0200
committerDiego Biurrun <diego@biurrun.de>2013-10-15 18:01:12 +0200
commit29c455ce3daf7fb369ba20cf77c74bd8e3b43b55 (patch)
treee17eb2766941a040a04952af4ad601b7fae0c81c /libavcodec/bitstream.c
parent3b4fa54866f58bf3d8a8dcc460c73ef6564c0ad8 (diff)
downloadffmpeg-29c455ce3daf7fb369ba20cf77c74bd8e3b43b55.tar.gz
bitstream: Check the result of av_malloc()
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 197e07f411..e7c476ba4b 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -283,6 +283,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);
assert(symbols_size <= 2 || !symbols);
j = 0;