glamor: Free converted bits in _glamor_upload_bits_to_pixmap_texture fast path
When uploading bits to a texture which need reformatting to match a supported GL format, a temporary buffer is allocated to hold the reformatted bits. This gets freed in the general path, but is not freed in the fast path because that includes an early return before the call to free. This patch removes the early return and places the general case under an 'else' block, so that both paths reach the call to free. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
55b27ed70c
commit
d181e52ceb
|
@ -808,9 +808,7 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format,
|
|||
format, type,
|
||||
x + fbo_x_off, y + fbo_y_off, w, h,
|
||||
bits, pbo);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
} else {
|
||||
ptexcoords = texcoords_inv;
|
||||
|
||||
pixmap_priv_get_dest_scale(pixmap_priv, &dst_xscale, &dst_yscale);
|
||||
|
@ -846,6 +844,7 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format,
|
|||
glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
|
||||
glDeleteTextures(1, &tex);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
}
|
||||
|
||||
if (need_free_bits)
|
||||
free(bits);
|
||||
|
|
Loading…
Reference in New Issue