projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
db61b9c
)
mesa: fix an error in uniform arrays in row calculating.
author
Jian Zhao
<jian.j.zhao@intel.com>
Wed, 5 Jan 2011 02:41:20 +0000
(10:41 +0800)
committer
Brian Paul
<brianp@vmware.com>
Fri, 7 Jan 2011 14:22:18 +0000
(07:22 -0700)
Fix the error in uniform row calculating, it may alloc one line
more which may cause out of range on memory usage, sometimes program
aborted when free the memory.
NOTE: This is a candidate for 7.9 and 7.10 branches.
Signed-off-by: Brian Paul <brianp@vmware.com>
src/mesa/main/uniforms.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/uniforms.c
b/src/mesa/main/uniforms.c
index 58e6bafc9188d51efdb411e8b5ca5cf25c6dbec0..aee2e6b4e9bc52579e3154c6a3204f733e8c76a8 100644
(file)
--- a/
src/mesa/main/uniforms.c
+++ b/
src/mesa/main/uniforms.c
@@
-513,7
+513,7
@@
get_uniform_rows_cols(const struct gl_program_parameter *p,
*cols = p->Size;
}
else {
- *rows =
p->Size / 4 + 1
;
+ *rows =
(p->Size + 3) / 4
;
if (p->Size % 4 == 0)
*cols = 4;
else