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

Side by Side Diff: cc/ipc/cc_param_traits.cc

Issue 2835203002: Reject CompositorFrames with no render passes when deserializing (Closed)
Patch Set: Fixed Android Webview Created 3 years, 8 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 | cc/ipc/compositor_frame_struct_traits.cc » ('j') | 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 "cc/ipc/cc_param_traits.h" 5 #include "cc/ipc/cc_param_traits.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 return false; 788 return false;
789 789
790 const size_t kMaxRenderPasses = 10000; 790 const size_t kMaxRenderPasses = 10000;
791 const size_t kMaxSharedQuadStateListSize = 100000; 791 const size_t kMaxSharedQuadStateListSize = 100000;
792 const size_t kMaxQuadListSize = 1000000; 792 const size_t kMaxQuadListSize = 1000000;
793 793
794 std::set<int> pass_id_set; 794 std::set<int> pass_id_set;
795 795
796 uint32_t num_render_passes; 796 uint32_t num_render_passes;
797 if (!ReadParam(m, iter, &p->resource_list) || 797 if (!ReadParam(m, iter, &p->resource_list) ||
798 !ReadParam(m, iter, &num_render_passes) || 798 !ReadParam(m, iter, &num_render_passes) || num_render_passes == 0 ||
799 num_render_passes > kMaxRenderPasses) 799 num_render_passes > kMaxRenderPasses)
800 return false; 800 return false;
801 for (uint32_t i = 0; i < num_render_passes; ++i) { 801 for (uint32_t i = 0; i < num_render_passes; ++i) {
802 uint32_t quad_list_size; 802 uint32_t quad_list_size;
803 uint32_t shared_quad_state_list_size; 803 uint32_t shared_quad_state_list_size;
804 if (!ReadParam(m, iter, &quad_list_size) || 804 if (!ReadParam(m, iter, &quad_list_size) ||
805 !ReadParam(m, iter, &shared_quad_state_list_size) || 805 !ReadParam(m, iter, &shared_quad_state_list_size) ||
806 quad_list_size > kMaxQuadListSize || 806 quad_list_size > kMaxQuadListSize ||
807 shared_quad_state_list_size > kMaxSharedQuadStateListSize) 807 shared_quad_state_list_size > kMaxSharedQuadStateListSize)
808 return false; 808 return false;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 982 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
983 #include "cc/ipc/cc_param_traits_macros.h" 983 #include "cc/ipc/cc_param_traits_macros.h"
984 } // namespace IPC 984 } // namespace IPC
985 985
986 // Generate param traits log methods. 986 // Generate param traits log methods.
987 #include "ipc/param_traits_log_macros.h" 987 #include "ipc/param_traits_log_macros.h"
988 namespace IPC { 988 namespace IPC {
989 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 989 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
990 #include "cc/ipc/cc_param_traits_macros.h" 990 #include "cc/ipc/cc_param_traits_macros.h"
991 } // namespace IPC 991 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | cc/ipc/compositor_frame_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698