mesa/st: fix crash in st_texture_image_copy
authorMarek Olšák <maraeo@gmail.com>
Wed, 28 Oct 2009 00:38:40 +0000 (01:38 +0100)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 28 Oct 2009 19:15:33 +0000 (12:15 -0700)
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
src/mesa/state_tracker/st_texture.c

index ba8d1e8cc160c4b6543a8aec946e738ceaf17fed..3f30137747afc1f2c64f66c039457ee8a427b692 100644 (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);