access: bluray: check overlay number
authorFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 9 Mar 2020 13:29:17 +0000 (14:29 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 9 Mar 2020 13:51:22 +0000 (14:51 +0100)
should not happen for now, but 3D comments of libbluray
mentions possible additional overlays

modules/access/bluray.c

index 252c625..d902fc5 100644 (file)
@@ -1998,6 +1998,9 @@ static void blurayOverlayProc(void *ptr, const BD_OVERLAY *const overlay)
         return;
     }
 
+    if(overlay->plane >= MAX_OVERLAY)
+        return;
+
     switch (overlay->cmd) {
     case BD_OVERLAY_INIT:
         msg_Info(p_demux, "Initializing overlay");
@@ -2098,6 +2101,9 @@ static void blurayArgbOverlayProc(void *ptr, const BD_ARGB_OVERLAY *const overla
     demux_t *p_demux = (demux_t*)ptr;
     demux_sys_t *p_sys = p_demux->p_sys;
 
+    if(overlay->plane >= MAX_OVERLAY)
+        return;
+
     switch (overlay->cmd) {
     case BD_ARGB_OVERLAY_INIT:
         vlc_mutex_lock(&p_sys->bdj.lock);