diff --git a/modules/access/bluray.c b/modules/access/bluray.c index 337b4d88f8208e892555786e9586e389d1b452c4..09d8d1075beb10bb69072d64f6f7a02e4db70829 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 */