mirror of
https://github.com/mpv-player/mpv
synced 2025-03-01 03:40:43 +00:00
vo_opengl: fix minor memory leak
Don't leak the buffer if glGetProgramBinary() fails.
This commit is contained in:
parent
bed421d483
commit
1adf324d8b
@ -661,8 +661,11 @@ static GLuint load_program(struct ra *ra, const struct ra_renderpass_params *p,
|
|||||||
gl->GetProgramBinary(prog, size, &actual_size, &binary_format,
|
gl->GetProgramBinary(prog, size, &actual_size, &binary_format,
|
||||||
buffer + 4);
|
buffer + 4);
|
||||||
AV_WL32(buffer, binary_format);
|
AV_WL32(buffer, binary_format);
|
||||||
if (actual_size)
|
if (actual_size) {
|
||||||
*out_cached_data = (bstr){buffer, actual_size + 4};
|
*out_cached_data = (bstr){buffer, actual_size + 4};
|
||||||
|
} else {
|
||||||
|
talloc_free(buffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user