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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2699033003: A potential use of uninitialized data on buggy driver impl. (Closed)
Patch Set: Created 3 years, 10 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 6867 matching lines...) Expand 10 before | Expand all | Expand 10 after
6878 return GL_POINT_SIZE_RANGE; 6878 return GL_POINT_SIZE_RANGE;
6879 } 6879 }
6880 return pname; 6880 return pname;
6881 } 6881 }
6882 6882
6883 void GLES2DecoderImpl::DoGetBooleanv(GLenum pname, 6883 void GLES2DecoderImpl::DoGetBooleanv(GLenum pname,
6884 GLboolean* params, 6884 GLboolean* params,
6885 GLsizei params_size) { 6885 GLsizei params_size) {
6886 DCHECK(params); 6886 DCHECK(params);
6887 std::unique_ptr<GLint[]> values(new GLint[params_size]); 6887 std::unique_ptr<GLint[]> values(new GLint[params_size]);
6888 memset(values.get(), 0, params_size * sizeof(GLint));
6888 DoGetIntegerv(pname, values.get(), params_size); 6889 DoGetIntegerv(pname, values.get(), params_size);
6889 for (GLsizei ii = 0; ii < params_size; ++ii) { 6890 for (GLsizei ii = 0; ii < params_size; ++ii) {
6890 params[ii] = static_cast<GLboolean>(values[ii]); 6891 params[ii] = static_cast<GLboolean>(values[ii]);
6891 } 6892 }
6892 } 6893 }
6893 6894
6894 void GLES2DecoderImpl::DoGetFloatv(GLenum pname, 6895 void GLES2DecoderImpl::DoGetFloatv(GLenum pname,
6895 GLfloat* params, 6896 GLfloat* params,
6896 GLsizei params_size) { 6897 GLsizei params_size) {
6897 DCHECK(params); 6898 DCHECK(params);
6898 GLsizei num_written = 0; 6899 GLsizei num_written = 0;
6899 if (state_.GetStateAsGLfloat(pname, params, &num_written)) { 6900 if (state_.GetStateAsGLfloat(pname, params, &num_written)) {
6900 DCHECK_EQ(num_written, params_size); 6901 DCHECK_EQ(num_written, params_size);
6901 return; 6902 return;
6902 } 6903 }
6903 6904
6904 switch (pname) { 6905 switch (pname) {
6905 case GL_ALIASED_POINT_SIZE_RANGE: 6906 case GL_ALIASED_POINT_SIZE_RANGE:
6906 case GL_ALIASED_LINE_WIDTH_RANGE: 6907 case GL_ALIASED_LINE_WIDTH_RANGE:
6907 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: 6908 case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
6908 DCHECK_EQ(params_size, util_.GLGetNumValuesReturned(pname)); 6909 DCHECK_EQ(params_size, util_.GLGetNumValuesReturned(pname));
6909 pname = AdjustGetPname(pname); 6910 pname = AdjustGetPname(pname);
6910 glGetFloatv(pname, params); 6911 glGetFloatv(pname, params);
6911 return; 6912 return;
6912 } 6913 }
6913 6914
6914 std::unique_ptr<GLint[]> values(new GLint[params_size]); 6915 std::unique_ptr<GLint[]> values(new GLint[params_size]);
6916 memset(values.get(), 0, params_size * sizeof(GLint));
6915 DoGetIntegerv(pname, values.get(), params_size); 6917 DoGetIntegerv(pname, values.get(), params_size);
6916 for (GLsizei ii = 0; ii < params_size; ++ii) { 6918 for (GLsizei ii = 0; ii < params_size; ++ii) {
6917 params[ii] = static_cast<GLfloat>(values[ii]); 6919 params[ii] = static_cast<GLfloat>(values[ii]);
6918 } 6920 }
6919 } 6921 }
6920 6922
6921 void GLES2DecoderImpl::DoGetInteger64v(GLenum pname, 6923 void GLES2DecoderImpl::DoGetInteger64v(GLenum pname,
6922 GLint64* params, 6924 GLint64* params,
6923 GLsizei params_size) { 6925 GLsizei params_size) {
6924 DCHECK(params); 6926 DCHECK(params);
(...skipping 10 matching lines...) Expand all
6935 if (params) { 6937 if (params) {
6936 *params = std::numeric_limits<unsigned int>::max(); 6938 *params = std::numeric_limits<unsigned int>::max();
6937 } 6939 }
6938 } 6940 }
6939 return; 6941 return;
6940 } 6942 }
6941 } 6943 }
6942 } 6944 }
6943 6945
6944 std::unique_ptr<GLint[]> values(new GLint[params_size]); 6946 std::unique_ptr<GLint[]> values(new GLint[params_size]);
6947 memset(values.get(), 0, params_size * sizeof(GLint));
6945 DoGetIntegerv(pname, values.get(), params_size); 6948 DoGetIntegerv(pname, values.get(), params_size);
6946 for (GLsizei ii = 0; ii < params_size; ++ii) { 6949 for (GLsizei ii = 0; ii < params_size; ++ii) {
6947 params[ii] = static_cast<GLint64>(values[ii]); 6950 params[ii] = static_cast<GLint64>(values[ii]);
6948 } 6951 }
6949 } 6952 }
6950 6953
6951 void GLES2DecoderImpl::DoGetIntegerv(GLenum pname, 6954 void GLES2DecoderImpl::DoGetIntegerv(GLenum pname,
6952 GLint* params, 6955 GLint* params,
6953 GLsizei params_size) { 6956 GLsizei params_size) {
6954 DCHECK(params); 6957 DCHECK(params);
(...skipping 12352 matching lines...) Expand 10 before | Expand all | Expand 10 after
19307 } 19310 }
19308 19311
19309 // Include the auto-generated part of this file. We split this because it means 19312 // Include the auto-generated part of this file. We split this because it means
19310 // we can easily edit the non-auto generated parts right here in this file 19313 // we can easily edit the non-auto generated parts right here in this file
19311 // instead of having to edit some template or the code generator. 19314 // instead of having to edit some template or the code generator.
19312 #include "base/macros.h" 19315 #include "base/macros.h"
19313 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 19316 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
19314 19317
19315 } // namespace gles2 19318 } // namespace gles2
19316 } // namespace gpu 19319 } // namespace gpu
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