[vlc-commits] bluray: don't use a region if it's not allocated
Steve Lhomme
git at videolan.org
Mon Jan 7 13:55:04 CET 2019
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jan 7 12:27:33 2019 +0100| [65d86a44740a612dfccb04bc49b0a2a7974df358] | committer: Steve Lhomme
bluray: don't use a region if it's not allocated
(cherry picked from commit b315699d76399989811f87e2cceb674553bf6db8)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=65d86a44740a612dfccb04bc49b0a2a7974df358
---
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 337b4d88f8..09d8d1075b 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1755,13 +1755,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->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->p_overlays[ov->plane]->p_regions = p_reg;
+ }
}
/* Now we can update the region, regardless it's an update or an insert */
More information about the vlc-commits
mailing list