mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
u_blitter: check for invalid values in copy_buffer
This commit is contained in:
parent
df00dc3c81
commit
59fbd8c6be
1 changed files with 11 additions and 0 deletions
|
|
@ -1247,6 +1247,17 @@ void util_blitter_copy_buffer(struct blitter_context *blitter,
|
|||
struct pipe_vertex_buffer vb;
|
||||
struct pipe_stream_output_target *so_target;
|
||||
|
||||
if (srcx >= src->width0 ||
|
||||
dstx >= dst->width0) {
|
||||
return;
|
||||
}
|
||||
if (srcx + size > src->width0) {
|
||||
size = src->width0 - srcx;
|
||||
}
|
||||
if (dstx + size > dst->width0) {
|
||||
size = dst->width0 - dstx;
|
||||
}
|
||||
|
||||
/* Drivers not capable of Stream Out should not call this function
|
||||
* in the first place. */
|
||||
assert(ctx->has_stream_out);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue