From f6fa1ae673b463b8225e7ea23073fa0fcce345ad Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sat, 15 Feb 2025 15:46:10 -0600 Subject: [PATCH] stream_bluray: fix some title info leaks These are both not const and need to be freed after we're done. --- stream/stream_bluray.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c index 89281a1825..edfc80b8e8 100644 --- a/stream/stream_bluray.c +++ b/stream/stream_bluray.c @@ -270,20 +270,22 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg) int title = *(double *)arg; if (!b->bd || title < 0 || title >= b->num_titles) return STREAM_UNSUPPORTED; - const BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0); + BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0); if (!ti) return STREAM_UNSUPPORTED; *(double *)arg = BD_TIME_TO_MP(ti->duration); + bd_free_title_info(ti); return STREAM_OK; } case STREAM_CTRL_GET_TITLE_PLAYLIST: { int title = *(double *)arg; if (!b->bd || title < 0 || title >= b->num_titles) return STREAM_UNSUPPORTED; - const BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0); + BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0); if (!ti) return STREAM_UNSUPPORTED; *(double *)arg = ti->playlist; + bd_free_title_info(ti); return STREAM_OK; } case STREAM_CTRL_GET_LANG: {