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

Side by Side Diff: src/codec/SkBmpCodec.h

Issue 1498923002: Fix overflow caught by ASAN. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Make variable const. Created 5 years 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 | src/codec/SkBmpCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #ifndef SkBmpCodec_DEFINED 7 #ifndef SkBmpCodec_DEFINED
8 #define SkBmpCodec_DEFINED 8 #define SkBmpCodec_DEFINED
9 9
10 #include "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 * 74 *
75 * @param y Iterates from 0 to height, indicating the current row. 75 * @param y Iterates from 0 to height, indicating the current row.
76 * @param height The height of the current subset of the image that we are 76 * @param height The height of the current subset of the image that we are
77 * decoding. This is generally equal to the full height 77 * decoding. This is generally equal to the full height
78 * when we want to decode the full or one when we are 78 * when we want to decode the full or one when we are
79 * sampling. 79 * sampling.
80 */ 80 */
81 int32_t getDstRow(int32_t y, int32_t height) const; 81 int32_t getDstRow(int32_t y, int32_t height) const;
82 82
83 /* 83 /*
84 * Compute the number of colors in the color table
85 */
86 uint32_t computeNumColors(uint32_t numColors);
87
88 /*
89 * Accessors used by subclasses 84 * Accessors used by subclasses
90 */ 85 */
91 uint16_t bitsPerPixel() const { return fBitsPerPixel; } 86 uint16_t bitsPerPixel() const { return fBitsPerPixel; }
92 SkScanlineOrder onGetScanlineOrder() const override { return fRowOrder; } 87 SkScanlineOrder onGetScanlineOrder() const override { return fRowOrder; }
93 88
94 /* 89 /*
95 * To be overriden by bmp subclasses, which provide unique implementations. 90 * To be overriden by bmp subclasses, which provide unique implementations.
96 * Performs subclass specific setup. 91 * Performs subclass specific setup.
97 * 92 *
98 * @param dstInfo Contains output information. Height specifies 93 * @param dstInfo Contains output information. Height specifies
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 138
144 // TODO(msarett): Override default skipping with something more clever. 139 // TODO(msarett): Override default skipping with something more clever.
145 140
146 const uint16_t fBitsPerPixel; 141 const uint16_t fBitsPerPixel;
147 const SkScanlineOrder fRowOrder; 142 const SkScanlineOrder fRowOrder;
148 143
149 typedef SkCodec INHERITED; 144 typedef SkCodec INHERITED;
150 }; 145 };
151 146
152 #endif 147 #endif
OLDNEW
« no previous file with comments | « no previous file | src/codec/SkBmpCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698