Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(161)

Issue 6139064: Add validation checks (part 1/2) (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by bashi
Modified:
12 years ago
Reviewers:
agl, raph
CC:
Yusuke Sato
Base URL:
https://code.google.com/p/font-compression-reference@master
Visibility:
Public.

Description

This CL adds some validation checks. Following CLs will add further checks. This CL also changes pointer declarations from "type *variable" to "type* variable" to follow other OTS code. BUG=none TEST=compiled

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -74 lines) Patch
M cpp/woff2.cc View 1 31 chunks +113 lines, -74 lines 0 comments Download

Messages

Total messages: 4
bashi
Hi Raph, Could you take a look? I'd like to add validation checks before committing ...
12 years ago (2012-05-01 09:17:49 UTC) #1
agl
LGTM https://codereview.appspot.com/6139064/diff/1/cpp/woff2.cc File cpp/woff2.cc (right): https://codereview.appspot.com/6139064/diff/1/cpp/woff2.cc#newcode766 cpp/woff2.cc:766: if ((flag_byte & 0x1f) >= (sizeof(known_tags) / sizeof(uint32_t))) ...
12 years ago (2012-05-01 14:39:31 UTC) #2
raph
Looks good to me. Thanks! https://codereview.appspot.com/6139064/diff/1/cpp/woff2.cc File cpp/woff2.cc (right): https://codereview.appspot.com/6139064/diff/1/cpp/woff2.cc#newcode772 cpp/woff2.cc:772: if (flags == 3) ...
12 years ago (2012-05-01 15:55:34 UTC) #3
bashi
12 years ago (2012-05-02 00:03:39 UTC) #4
Thank you for review agl and raph!

http://codereview.appspot.com/6139064/diff/1/cpp/woff2.cc
File cpp/woff2.cc (right):

http://codereview.appspot.com/6139064/diff/1/cpp/woff2.cc#newcode766
cpp/woff2.cc:766: if ((flag_byte & 0x1f) >= (sizeof(known_tags) /
sizeof(uint32_t))) {
On 2012/05/01 14:39:31, agl wrote:
> sizeof(known_tags) / sizeof(known_tags[0]), in case the type ever changes.

Done.

http://codereview.appspot.com/6139064/diff/1/cpp/woff2.cc#newcode772
cpp/woff2.cc:772: if (flags == 3) {
On 2012/05/01 15:55:35, raph wrote:
> I'm thinking this should be a constant too, like kShortFlagsContinue

Done.

http://codereview.appspot.com/6139064/diff/1/cpp/woff2.cc#newcode863
cpp/woff2.cc:863: uint64_t dst_offset = kSfntHeaderSize + kSfntEntrySize *
num_tables;
On 2012/05/01 14:39:31, agl wrote:
> kSfntEntrySize is defined some way away, so num_tables should be
> static_cast<uint64_t>(num_tables) to make it locally clear that the arithmetic
> is ok.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b