[libbluray-devel] check for NULL

hpi1 git at videolan.org
Wed May 3 15:04:48 CEST 2017


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Apr  3 15:10:56 2017 +0300| [c5681611fdedd55f32348f9b914bc468237b49f4] | committer: hpi1

check for NULL

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=c5681611fdedd55f32348f9b914bc468237b49f4
---

 src/libbluray/bdnav/mpls_parse.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/libbluray/bdnav/mpls_parse.c b/src/libbluray/bdnav/mpls_parse.c
index 177f04c8..53522224 100644
--- a/src/libbluray/bdnav/mpls_parse.c
+++ b/src/libbluray/bdnav/mpls_parse.c
@@ -693,6 +693,10 @@ _parse_playlistmark(BITSTREAM *bits, MPLS_PL *pl)
     pl->mark_count = bs_read(bits, 16);
 
     plm = calloc(pl->mark_count, sizeof(MPLS_PLM));
+    if (pl->mark_count && !plm) {
+        BD_DEBUG(DBG_CRIT, "out of memory\n");
+        return 0;
+    }
     for (ii = 0; ii < pl->mark_count; ii++) {
         bs_skip(bits, 8); /* reserved */
         plm[ii].mark_type     = bs_read(bits, 8);



More information about the libbluray-devel mailing list