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

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

Issue 2184443004: Fix container overflow in DoScheduleCALayerFilterEffectsCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 10987 matching lines...) Expand 10 before | Expand all | Expand 10 after
10998 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM", 10998 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM",
10999 "failed to schedule CALayer"); 10999 "failed to schedule CALayer");
11000 } 11000 }
11001 return error::kNoError; 11001 return error::kNoError;
11002 } 11002 }
11003 11003
11004 void GLES2DecoderImpl::DoScheduleCALayerFilterEffectsCHROMIUM( 11004 void GLES2DecoderImpl::DoScheduleCALayerFilterEffectsCHROMIUM(
11005 GLsizei count, 11005 GLsizei count,
11006 const GLCALayerFilterEffect* filter_effects) { 11006 const GLCALayerFilterEffect* filter_effects) {
11007 std::vector<ui::CARendererLayerParams::FilterEffect> effects; 11007 std::vector<ui::CARendererLayerParams::FilterEffect> effects;
11008 effects.reserve(count); 11008 effects.resize(count);
11009 for (GLsizei i = 0; i < count; ++i) { 11009 for (GLsizei i = 0; i < count; ++i) {
11010 const GLCALayerFilterEffect& filter_effect = filter_effects[i]; 11010 const GLCALayerFilterEffect& filter_effect = filter_effects[i];
11011 GLint min = 11011 GLint min =
11012 static_cast<GLint>(ui::CARendererLayerParams::FilterEffectType::MIN); 11012 static_cast<GLint>(ui::CARendererLayerParams::FilterEffectType::MIN);
11013 GLint max = 11013 GLint max =
11014 static_cast<GLint>(ui::CARendererLayerParams::FilterEffectType::MAX); 11014 static_cast<GLint>(ui::CARendererLayerParams::FilterEffectType::MAX);
11015 if (filter_effect.type < min || filter_effect.type > max) { 11015 if (filter_effect.type < min || filter_effect.type > max) {
11016 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, 11016 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE,
11017 "glScheduleCALayerFilterEffectsCHROMIUM", 11017 "glScheduleCALayerFilterEffectsCHROMIUM",
11018 "Invalid filter type."); 11018 "Invalid filter type.");
(...skipping 6657 matching lines...) Expand 10 before | Expand all | Expand 10 after
17676 } 17676 }
17677 17677
17678 // Include the auto-generated part of this file. We split this because it means 17678 // Include the auto-generated part of this file. We split this because it means
17679 // we can easily edit the non-auto generated parts right here in this file 17679 // we can easily edit the non-auto generated parts right here in this file
17680 // instead of having to edit some template or the code generator. 17680 // instead of having to edit some template or the code generator.
17681 #include "base/macros.h" 17681 #include "base/macros.h"
17682 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 17682 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
17683 17683
17684 } // namespace gles2 17684 } // namespace gles2
17685 } // namespace gpu 17685 } // 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