Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/mesa/src/mesa/program/prog_parameter.c

Issue 17122007: Appease ASAN in Mesa 9.0.3 (Closed) Base URL: https://src.chromium.org/chrome/trunk/deps/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/mesa/src/mesa/program/prog_parameter.c
===================================================================
--- third_party/mesa/src/mesa/program/prog_parameter.c (revision 206490)
+++ third_party/mesa/src/mesa/program/prog_parameter.c (working copy)
@@ -158,7 +158,18 @@
p->DataType = datatype;
p->Flags = flags;
if (values) {
- COPY_4V(paramList->ParameterValues[oldNum + i], values);
+ if (size >= (i+1)*4) {
+ COPY_4V(paramList->ParameterValues[oldNum + i], values);
+ } else {
+ /* silence asan */
+ for (j = 0; j < 4; j++) {
+ if (i*4+j < size) {
+ paramList->ParameterValues[oldNum + i][j] = values[i*4+j];
+ } else {
+ paramList->ParameterValues[oldNum + i][j].f = 0.0f;
+ }
+ }
+ }
values += 4;
p->Initialized = GL_TRUE;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698