From aa74810fc6b9afe21c9be3725e3d078d10633670 Mon Sep 17 00:00:00 2001 From: Piotr Bandurski Date: Tue, 9 Jul 2013 19:29:26 +0200 Subject: [PATCH] bitstream: fix a crash in case of oom fixes ticket #2766 Signed-off-by: Michael Niedermayer --- libavcodec/bitstream.c | 2 ++ 1 file changed, 2 insertions(+) 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;