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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Mesa 3-D graphics library 2 * Mesa 3-D graphics library
3 * Version: 7.3 3 * Version: 7.3
4 * 4 *
5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. 5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
6 * 6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a 7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"), 8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation 9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 sz4 * sizeof(struct gl_program_parameter)); 151 sz4 * sizeof(struct gl_program_parameter));
152 152
153 for (i = 0; i < sz4; i++) { 153 for (i = 0; i < sz4; i++) {
154 struct gl_program_parameter *p = paramList->Parameters + oldNum + i; 154 struct gl_program_parameter *p = paramList->Parameters + oldNum + i;
155 p->Name = name ? _mesa_strdup(name) : NULL; 155 p->Name = name ? _mesa_strdup(name) : NULL;
156 p->Type = type; 156 p->Type = type;
157 p->Size = size; 157 p->Size = size;
158 p->DataType = datatype; 158 p->DataType = datatype;
159 p->Flags = flags; 159 p->Flags = flags;
160 if (values) { 160 if (values) {
161 COPY_4V(paramList->ParameterValues[oldNum + i], values); 161 if (size >= (i+1)*4) {
162 COPY_4V(paramList->ParameterValues[oldNum + i], values);
163 } else {
164 /* silence asan */
165 for (j = 0; j < 4; j++) {
166 if (i*4+j < size) {
167 paramList->ParameterValues[oldNum + i][j] = values[i*4+j];
168 } else {
169 paramList->ParameterValues[oldNum + i][j].f = 0.0f;
170 }
171 }
172 }
162 values += 4; 173 values += 4;
163 p->Initialized = GL_TRUE; 174 p->Initialized = GL_TRUE;
164 } 175 }
165 else { 176 else {
166 /* silence valgrind */ 177 /* silence valgrind */
167 for (j = 0; j < 4; j++) 178 for (j = 0; j < 4; j++)
168 paramList->ParameterValues[oldNum + i][j].f = 0; 179 paramList->ParameterValues[oldNum + i][j].f = 0;
169 } 180 }
170 size -= 4; 181 size -= 4;
171 } 182 }
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 { 660 {
650 GLuint i, count = 0; 661 GLuint i, count = 0;
651 if (list) { 662 if (list) {
652 for (i = 0; i < list->NumParameters; i++) { 663 for (i = 0; i < list->NumParameters; i++) {
653 if (list->Parameters[i].Type == type) 664 if (list->Parameters[i].Type == type)
654 count++; 665 count++;
655 } 666 }
656 } 667 }
657 return count; 668 return count;
658 } 669 }
OLDNEW
« 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