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

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

Issue 1058873006: Get rid of leaks in SkCodec::NewFromStream. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment that ReadHeader does not own SkStream. Created 5 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 | « src/codec/SkCodec.cpp ('k') | src/codec/SkCodec_libbmp.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 7
8 #include "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkColorTable.h" 9 #include "SkColorTable.h"
10 #include "SkImageInfo.h" 10 #include "SkImageInfo.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 * Reads enough of the stream to determine the image format 96 * Reads enough of the stream to determine the image format
97 * 97 *
98 */ 98 */
99 static SkCodec* NewFromStream(SkStream*, bool isIco); 99 static SkCodec* NewFromStream(SkStream*, bool isIco);
100 100
101 /* 101 /*
102 * 102 *
103 * Read enough of the stream to initialize the SkBmpCodec. Returns a bool 103 * Read enough of the stream to initialize the SkBmpCodec. Returns a bool
104 * representing success or failure. If it returned true, and codecOut was 104 * representing success or failure. If it returned true, and codecOut was
105 * not NULL, it will be set to a new SkBmpCodec. 105 * not NULL, it will be set to a new SkBmpCodec.
106 * Does *not* take ownership of the passed in SkStream.
106 * 107 *
107 */ 108 */
108 static bool ReadHeader(SkStream*, bool isIco, SkCodec** codecOut); 109 static bool ReadHeader(SkStream*, bool isIco, SkCodec** codecOut);
109 110
110 /* 111 /*
111 * 112 *
112 * Performs the bitmap decoding for bit masks input format 113 * Performs the bitmap decoding for bit masks input format
113 * 114 *
114 */ 115 */
115 Result decodeMask(const SkImageInfo& dstInfo, void* dst, 116 Result decodeMask(const SkImageInfo& dstInfo, void* dst,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 SkAutoTDelete<SkColorTable> fColorTable; // owned 184 SkAutoTDelete<SkColorTable> fColorTable; // owned
184 uint32_t fNumColors; 185 uint32_t fNumColors;
185 const uint32_t fBytesPerColor; 186 const uint32_t fBytesPerColor;
186 const uint32_t fOffset; 187 const uint32_t fOffset;
187 const RowOrder fRowOrder; 188 const RowOrder fRowOrder;
188 const size_t fRLEBytes; 189 const size_t fRLEBytes;
189 const bool fIsIco; 190 const bool fIsIco;
190 191
191 typedef SkCodec INHERITED; 192 typedef SkCodec INHERITED;
192 }; 193 };
OLDNEW
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/codec/SkCodec_libbmp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698