From 29c455ce3daf7fb369ba20cf77c74bd8e3b43b55 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 15 Oct 2013 14:34:55 +0200 Subject: bitstream: Check the result of av_malloc() --- libavcodec/bitstream.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec') 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; -- cgit v1.2.3