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

Unified Diff: cc/ipc/render_pass_struct_traits.cc

Issue 2170603002: cc: Fix negative integer overflow in RenderPass serialization code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test. Created 4 years, 5 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 | cc/ipc/struct_traits_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/ipc/render_pass_struct_traits.cc
diff --git a/cc/ipc/render_pass_struct_traits.cc b/cc/ipc/render_pass_struct_traits.cc
index 86797298da516a899b4f5e182193c81a60e615dc..429ce05ca2118e003d7af12168326eb3ac4fa77f 100644
--- a/cc/ipc/render_pass_struct_traits.cc
+++ b/cc/ipc/render_pass_struct_traits.cc
@@ -71,7 +71,8 @@ bool StructTraits<cc::mojom::RenderPass, std::unique_ptr<cc::RenderPass>>::Read(
if (!(*it)->shared_quad_state)
return false;
}
- return sqs_iter.index() == (*out)->shared_quad_state_list.size() - 1;
+ return (*out)->shared_quad_state_list.empty() ||
+ sqs_iter.index() == (*out)->shared_quad_state_list.size() - 1;
}
} // namespace mojo
« no previous file with comments | « no previous file | cc/ipc/struct_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698