Skip to content

player: osd: fix memory leak on vlc_memstream

Fix memstream stream being open but never closed when zero tracks were to be displayed to the OSD. The code was opening the vlc_memstream from the start but was freeing the pointer only when the close of the memstream succeeded AND the number of tracks was non-null.

Instead, this patch reorder the code so that the vlc_memstream is allocated only when there is at least one track to display and early exit with the N/A OSD message otherwise.

Then it tries to close the memstream and exit in case of error.

Finally, the text is sent to the OSD and the pointer is freed.

It was raising an ASAN leak report on test_src_player through the test_teletext test function.

Fixes #26732 (closed)

Merge request reports