[vlc-commits] access: bluray: check input title allocation

Francois Cartegnie git at videolan.org
Mon Aug 28 09:30:30 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Aug 25 12:57:36 2017 +0200| [7254613061f72db359af7812ea8dbd59d89c20b3] | committer: Francois Cartegnie

access: bluray: check input title allocation

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7254613061f72db359af7812ea8dbd59d89c20b3
---

 modules/access/bluray.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index b76ef250e8..76e5bc6009 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1852,10 +1852,16 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
         *pi_chapter_offset = 0;
 
         /* Duplicate local title infos */
-        *pi_int = p_sys->i_title;
+        *pi_int = 0;
         *ppp_title = malloc(p_sys->i_title * sizeof(input_title_t *));
+        if(!*ppp_title)
+            return VLC_EGENERIC;
         for (unsigned int i = 0; i < p_sys->i_title; i++)
-            (*ppp_title)[i] = vlc_input_title_Duplicate(p_sys->pp_title[i]);
+        {
+            input_title_t *p_dup = vlc_input_title_Duplicate(p_sys->pp_title[i]);
+            if(p_dup)
+                (*ppp_title)[(*pi_int)++] = p_dup;
+        }
 
         return VLC_SUCCESS;
     }



More information about the vlc-commits mailing list