diff options
author | wm4 <wm4@nowhere> | 2017-08-07 18:46:40 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-08-07 18:46:40 +0200 |
commit | 1adf324d8b1261abfc02d905f98055991b29ac11 (patch) | |
tree | 5190320112450ced649be343e25cc69d3340433f /video/out | |
parent | bed421d4832179fc6254a6f54e2f779afe40ad63 (diff) | |
download | mpv-1adf324d8b1261abfc02d905f98055991b29ac11.tar.bz2 mpv-1adf324d8b1261abfc02d905f98055991b29ac11.tar.xz |
vo_opengl: fix minor memory leak
Don't leak the buffer if glGetProgramBinary() fails.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/opengl/ra_gl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c index 8c36fa11ff..a1373588fc 100644 --- a/video/out/opengl/ra_gl.c +++ b/video/out/opengl/ra_gl.c @@ -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, buffer + 4); AV_WL32(buffer, binary_format); - if (actual_size) + if (actual_size) { *out_cached_data = (bstr){buffer, actual_size + 4}; + } else { + talloc_free(buffer); + } } } |