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

Side by Side Diff: third_party/brotli/enc/encode.cc

Issue 2027873006: Fix an unitialized variable warning in Brotli. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « third_party/brotli/README.chromium ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright 2013 Google Inc. All Rights Reserved. 1 /* Copyright 2013 Google Inc. All Rights Reserved.
2 2
3 Distributed under MIT license. 3 Distributed under MIT license.
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5 */ 5 */
6 6
7 // Implementation of Brotli compressor. 7 // Implementation of Brotli compressor.
8 8
9 #include "./encode.h" 9 #include "./encode.h"
10 10
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 } 1148 }
1149 delete[] storage; 1149 delete[] storage;
1150 delete[] table; 1150 delete[] table;
1151 delete[] command_buf; 1151 delete[] command_buf;
1152 delete[] literal_buf; 1152 delete[] literal_buf;
1153 return ok; 1153 return ok;
1154 } 1154 }
1155 1155
1156 size_t in_bytes = 0; 1156 size_t in_bytes = 0;
1157 size_t out_bytes = 0; 1157 size_t out_bytes = 0;
1158 uint8_t* output; 1158 uint8_t* output = NULL;
1159 bool final_block = false; 1159 bool final_block = false;
1160 BrotliCompressor compressor(params); 1160 BrotliCompressor compressor(params);
1161 if (dictsize != 0) compressor.BrotliSetCustomDictionary(dictsize, dict); 1161 if (dictsize != 0) compressor.BrotliSetCustomDictionary(dictsize, dict);
1162 while (!final_block) { 1162 while (!final_block) {
1163 if (!CopyOneBlockToRingBuffer(in, &compressor, &in_bytes, &final_block)) { 1163 if (!CopyOneBlockToRingBuffer(in, &compressor, &in_bytes, &final_block)) {
1164 return false; 1164 return false;
1165 } 1165 }
1166 out_bytes = 0; 1166 out_bytes = 0;
1167 if (!compressor.WriteBrotliData(final_block, 1167 if (!compressor.WriteBrotliData(final_block,
1168 /* force_flush = */ false, 1168 /* force_flush = */ false,
1169 &out_bytes, &output)) { 1169 &out_bytes, &output)) {
1170 return false; 1170 return false;
1171 } 1171 }
1172 if (out_bytes > 0 && !out->Write(output, out_bytes)) { 1172 if (out_bytes > 0 && !out->Write(output, out_bytes)) {
1173 return false; 1173 return false;
1174 } 1174 }
1175 } 1175 }
1176 return true; 1176 return true;
1177 } 1177 }
1178 1178
1179 1179
1180 } // namespace brotli 1180 } // namespace brotli
OLDNEW
« no previous file with comments | « third_party/brotli/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698