Module: libav
Branch: master
Commit: 29c455ce3daf7fb369ba20cf77c74bd8e3b43b55

Author:    Diego Biurrun <[email protected]>
Committer: Diego Biurrun <[email protected]>
Date:      Tue Oct 15 14:34:55 2013 +0200

bitstream: Check the result of av_malloc()

---

 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;

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to