vlc | branch: master | Steve Lhomme <rob...@ycbcr.xyz> | Mon Jan  7 12:27:33 
2019 +0100| [b315699d76399989811f87e2cceb674553bf6db8] | committer: Steve Lhomme

bluray: don't use a region if it's not allocated

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

 modules/access/bluray.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 6e8125f4c0..9fe2cf37d1 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1917,13 +1917,15 @@ static void blurayDrawOverlay(demux_t *p_demux, const 
BD_OVERLAY* const ov)
         video_format_Setup(&fmt, VLC_CODEC_YUVP, ov->w, ov->h, ov->w, ov->h, 
1, 1);
 
         p_reg = subpicture_region_New(&fmt);
-        p_reg->i_x = ov->x;
-        p_reg->i_y = ov->y;
-        /* Append it to our list. */
-        if (p_last != NULL)
-            p_last->p_next = p_reg;
-        else /* If we don't have a last region, then our list empty */
-            p_sys->bdj.p_overlays[ov->plane]->p_regions = p_reg;
+        if (p_reg) {
+            p_reg->i_x = ov->x;
+            p_reg->i_y = ov->y;
+            /* Append it to our list. */
+            if (p_last != NULL)
+                p_last->p_next = p_reg;
+            else /* If we don't have a last region, then our list empty */
+                p_sys->bdj.p_overlays[ov->plane]->p_regions = p_reg;
+        }
     }
 
     /* Now we can update the region, regardless it's an update or an insert */

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to