Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix randomly broken mlt_repository with relocatable flag #1031

Merged
merged 1 commit into from
Sep 28, 2024

Conversation

j-b-m
Copy link
Contributor

@j-b-m j-b-m commented Sep 28, 2024

While working on our automated render tests suite, I came across seemingly random failures rendering with our AppImage with an error message like:
mlt_repository_init: no plugins found in "/$HOME/git/kdenlive-test-suite/squashfs-root/usr/bin/lib/mlt-7"
Looking into the details, I realized that the path set for mlt_repository_init was randomly incorrect when MLT is compiled with the relocatable flag.

Turns out the readlink [1] method used to retrieve the current path returns a string that is not terminated by a null character, so some garbage was appended to the path. Currently, the path returned by readlink looks like:

/$HOME/git/kdenlive-test-suite/squashfs-root/usr/bin/melt-7�N� or
/$HOME/git/kdenlive-test-suite/squashfs-root/usr/bin/melt-7�n/@�~

Whenever a slash happens to be in these garbage chars, the path points to the wrong folder.

This patch ensures the string return by readlink is correctly terminated.

[1] https://github.com/mltframework/mlt/blob/master/src/framework/mlt_factory.c#L156

@bmatherly
Copy link
Member

LGTM

@ddennedy ddennedy merged commit c6dc282 into mltframework:master Sep 28, 2024
6 checks passed
@ddennedy ddennedy added this to the v7.28.0 milestone Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants