mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 11:00:11 +01:00
util: Move dereference after null check in util_resource_copy_region.
Fixes dereference before null check defect reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
a5ca29100b
commit
3e7b3a04bf
1 changed files with 3 additions and 3 deletions
|
|
@ -160,12 +160,12 @@ util_resource_copy_region(struct pipe_context *pipe,
|
|||
unsigned h = src_box->height;
|
||||
|
||||
assert(src && dst);
|
||||
assert((src->target == PIPE_BUFFER && dst->target == PIPE_BUFFER) ||
|
||||
(src->target != PIPE_BUFFER && dst->target != PIPE_BUFFER));
|
||||
|
||||
if (!src || !dst)
|
||||
return;
|
||||
|
||||
assert((src->target == PIPE_BUFFER && dst->target == PIPE_BUFFER) ||
|
||||
(src->target != PIPE_BUFFER && dst->target != PIPE_BUFFER));
|
||||
|
||||
src_format = src->format;
|
||||
dst_format = dst->format;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue