stream_dvdnav: don't leak times in STREAM_CTRL_GET_CHAPTER_TIME

This commit is contained in:
Kacper Michajłow committed 2026-05-01 05:01:37 +02:00
1 parent 4182a1df43
commit 48bd97b5bb
1 file changed
+3 -1
+3 -1
View File
@@ -384,8 +384,10 @@ static int control(stream_t *stream, int cmd, void *arg)
int n = dvdnav_describe_title_chapters(dvdnav, tit, &parts, &duration);
if (!parts)
break;
if (chapter < 0 || chapter + 1 > n)
if (chapter < 0 || chapter + 1 > n) {
free(parts);
break;
}
*ch = chapter > 0 ? parts[chapter - 1] / 90000.0 : 0;
free(parts);
return STREAM_OK;