diff options
author | Brian Paul <[email protected]> | 2010-06-29 15:40:15 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-06-29 15:40:19 -0600 |
commit | 3d6101245b2726721a26931e0491c61286ca29c6 (patch) | |
tree | d6b53f8b69309e27a6803181d86e59bab103d030 /src/gallium/drivers/llvmpipe/lp_surface.c | |
parent | 249c6735dd5679be9f6ab8951982253919152985 (diff) |
llvmpipe: don't crash/assert on out of memory
Check for null pointers and return early, etc.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_surface.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_surface.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_surface.c b/src/gallium/drivers/llvmpipe/lp_surface.c index f0cbbe8c560..f761e828500 100644 --- a/src/gallium/drivers/llvmpipe/lp_surface.c +++ b/src/gallium/drivers/llvmpipe/lp_surface.c @@ -146,13 +146,15 @@ lp_resource_copy(struct pipe_context *pipe, subdst.level, LP_TEX_LAYOUT_LINEAR); - util_copy_rect(dst_linear_ptr, format, - llvmpipe_resource_stride(&dst_tex->base, subdst.level), - dstx, dsty, - width, height, - src_linear_ptr, - llvmpipe_resource_stride(&src_tex->base, subsrc.level), - srcx, srcy); + if (dst_linear_ptr && src_linear_ptr) { + util_copy_rect(dst_linear_ptr, format, + llvmpipe_resource_stride(&dst_tex->base, subdst.level), + dstx, dsty, + width, height, + src_linear_ptr, + llvmpipe_resource_stride(&src_tex->base, subsrc.level), + srcx, srcy); + } } } |