mesa/st: fix crash in st_texture_image_copy

Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
This commit is contained in:
Marek Olšák 2009-10-28 01:38:40 +01:00 committed by Corbin Simpson
parent 7d56caabe4
commit c451011d99

View file

@ -342,12 +342,21 @@ st_texture_image_copy(struct pipe_context *pipe,
src_surface = screen->get_tex_surface(screen, src, face, srcLevel, i,
PIPE_BUFFER_USAGE_GPU_READ);
pipe->surface_copy(pipe,
dst_surface,
0, 0, /* destX, Y */
src_surface,
0, 0, /* srcX, Y */
width, height);
if (pipe->surface_copy) {
pipe->surface_copy(pipe,
dst_surface,
0, 0, /* destX, Y */
src_surface,
0, 0, /* srcX, Y */
width, height);
} else {
util_surface_copy(pipe, FALSE,
dst_surface,
0, 0, /* destX, Y */
src_surface,
0, 0, /* srcX, Y */
width, height);
}
pipe_surface_reference(&src_surface, NULL);
pipe_surface_reference(&dst_surface, NULL);