History

stream_bluray: fix some title info leaks

These are both not const and need to be freed after we're done.

Dudemanguy committed 1 year ago

Commit f6fa1ae1 parent affea091 file · +4 −2Browse files

Unified · Split

stream/stream_bluray.c+4−2
@@ -270,20 +270,22 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg) · 269 unmodified lines
270270 int title = *(double *)arg;
271271 if (!b->bd || title < 0 || title >= b->num_titles)
272272 return STREAM_UNSUPPORTED;
273− const BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0);
273+ BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0);
274274 if (!ti)
275275 return STREAM_UNSUPPORTED;
276276 *(double *)arg = BD_TIME_TO_MP(ti->duration);
277+ bd_free_title_info(ti);
277278 return STREAM_OK;
278279 }
279280 case STREAM_CTRL_GET_TITLE_PLAYLIST: {
280281 int title = *(double *)arg;
281282 if (!b->bd || title < 0 || title >= b->num_titles)
282283 return STREAM_UNSUPPORTED;
283− const BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0);
284+ BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0);
284285 if (!ti)
285286 return STREAM_UNSUPPORTED;
286287 *(double *)arg = ti->playlist;
288+ bd_free_title_info(ti);
287289 return STREAM_OK;
288290 }
289291 case STREAM_CTRL_GET_LANG: {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t