[FFmpeg-cvslog] bitstream: Check the result of av_malloc()
Diego Biurrun
git at videolan.org
Wed Oct 16 11:39:23 CEST 2013
ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Tue Oct 15 14:34:55 2013 +0200| [29c455ce3daf7fb369ba20cf77c74bd8e3b43b55] | committer: Diego Biurrun
bitstream: Check the result of av_malloc()
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=29c455ce3daf7fb369ba20cf77c74bd8e3b43b55
---
libavcodec/bitstream.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 197e07f..e7c476b 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;
More information about the ffmpeg-cvslog
mailing list