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

Unified Diff: src/woff2.cc

Issue 28363002: [OTS] Fix "continue-stream" handling in the woff2 decoder (Closed) Base URL: http://ots.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/woff2.cc
===================================================================
--- src/woff2.cc (revision 103)
+++ src/woff2.cc (working copy)
@@ -826,6 +826,10 @@
if (!ReadBase128(file, &src_length)) {
return OTS_FAILURE();
}
+ } else if ((flag_byte >> 6) == kShortFlagsContinue) {
+ // The compressed data for this table is in a previuos table, so we set
+ // the src_length to zero.
+ src_length = 0;
}
// Disallow huge numbers (> 1GB) for sanity.
if (src_length > 1024 * 1024 * 1024 ||
@@ -954,12 +958,12 @@
}
std::vector<uint8_t> uncompressed_buf;
bool continue_valid = false;
+ const uint8_t* transform_buf = NULL;
for (uint16_t i = 0; i < num_tables; ++i) {
const Table* table = &tables.at(i);
uint32_t flags = table->flags;
const uint8_t* src_buf = data + table->src_offset;
uint32_t compression_type = flags & kCompressionTypeMask;
- const uint8_t* transform_buf = NULL;
size_t transform_length = table->transform_length;
if ((flags & kWoff2FlagsContinueStream) != 0) {
if (!continue_valid) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698