projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df00dc3
)
u_blitter: check for invalid values in copy_buffer
author
Marek Olšák
<maraeo@gmail.com>
Fri, 24 Feb 2012 01:24:22 +0000
(
02:24
+0100)
committer
Marek Olšák
<maraeo@gmail.com>
Fri, 24 Feb 2012 01:28:54 +0000
(
02:28
+0100)
src/gallium/auxiliary/util/u_blitter.c
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/util/u_blitter.c
b/src/gallium/auxiliary/util/u_blitter.c
index 6a32de619efaf59447b612c7661dcaca9c86d524..be420ec155620e5404689932d47c66c0e8458f9d 100644
(file)
--- a/
src/gallium/auxiliary/util/u_blitter.c
+++ b/
src/gallium/auxiliary/util/u_blitter.c
@@
-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);