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

Side by Side Diff: pdf/draw_utils.h

Issue 544863002: Preven OOB memory access in chrome_pdf::AlphaBlend(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | pdf/draw_utils.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef PDF_DRAW_UTILS_H_ 5 #ifndef PDF_DRAW_UTILS_H_
6 #define PDF_DRAW_UTILS_H_ 6 #define PDF_DRAW_UTILS_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "ppapi/cpp/image_data.h" 11 #include "ppapi/cpp/image_data.h"
12 #include "ppapi/cpp/rect.h" 12 #include "ppapi/cpp/rect.h"
13 13
14 namespace chrome_pdf { 14 namespace chrome_pdf {
15 15
16 const uint8 kOpaqueAlpha = 0xFF; 16 const uint8 kOpaqueAlpha = 0xFF;
17 const uint8 kTransparentAlpha = 0x00; 17 const uint8 kTransparentAlpha = 0x00;
18 18
19 bool AlphaBlend(const pp::ImageData& src, const pp::Rect& src_rc, 19 void AlphaBlend(const pp::ImageData& src, const pp::Rect& src_rc,
20 pp::ImageData* dest, const pp::Point& dest_origin, 20 pp::ImageData* dest, const pp::Point& dest_origin,
21 uint8 alpha_adjustment); 21 uint8 alpha_adjustment);
22 22
23 // Fill rectangle with gradient horizontally or vertically. Start is a color of 23 // Fill rectangle with gradient horizontally or vertically. Start is a color of
24 // top-left point of the rectangle, end color is a color of 24 // top-left point of the rectangle, end color is a color of
25 // top-right (horizontal==true) or bottom-left (horizontal==false) point. 25 // top-right (horizontal==true) or bottom-left (horizontal==false) point.
26 void GradientFill(pp::ImageData* image, 26 void GradientFill(pp::ImageData* image,
27 const pp::Rect& rc, 27 const pp::Rect& rc,
28 uint32 start_color, 28 uint32 start_color,
29 uint32 end_color, 29 uint32 end_color,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // clip_rc - clipping region 85 // clip_rc - clipping region
86 void DrawShadow(pp::ImageData* image, 86 void DrawShadow(pp::ImageData* image,
87 const pp::Rect& shadow_rc, 87 const pp::Rect& shadow_rc,
88 const pp::Rect& object_rc, 88 const pp::Rect& object_rc,
89 const pp::Rect& clip_rc, 89 const pp::Rect& clip_rc,
90 const ShadowMatrix& matrix); 90 const ShadowMatrix& matrix);
91 91
92 } // namespace chrome_pdf 92 } // namespace chrome_pdf
93 93
94 #endif // PDF_DRAW_UTILS_H_ 94 #endif // PDF_DRAW_UTILS_H_
OLDNEW
« no previous file with comments | « no previous file | pdf/draw_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698