vo_libmpv: don't steal pointer provided by the API user

It won't be TA allocated and would fail on header check. Also
documentation doesn't mention that ownership is transfered to mpv, so it
is unexpected.

This will cause existing clients of this API leak this memory, but I
doubt anyone really used it in this broken state.

Fixes: #14633
This commit is contained in:
Kacper Michajłow
2024-08-04 21:51:25 +02:00
parent 25f441b740
commit 6f619d5ef4
3 changed files with 6 additions and 3 deletions

View File

@@ -107,7 +107,7 @@ static int set_parameter(struct render_backend *ctx, mpv_render_param param)
switch (param.type) {
case MPV_RENDER_PARAM_ICC_PROFILE: {
mpv_byte_array *data = param.data;
gl_video_set_icc_profile(p->renderer, (bstr){data->data, data->size});
gl_video_set_icc_profile(p->renderer, bstrdup(NULL, (bstr){data->data, data->size}));
return 0;
}
case MPV_RENDER_PARAM_AMBIENT_LIGHT: {