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

Unified Diff: third_party/brotli/dec/streams.c

Issue 1061993007: Update Brotli to revision ec03509 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/brotli/dec/state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/brotli/dec/streams.c
diff --git a/third_party/brotli/dec/streams.c b/third_party/brotli/dec/streams.c
index 623d417cf4c7100ff7d1303fb403944b4888784c..b33f7a46e9e26ad20f51fb1b2f40bdbc6b0a9b45 100644
--- a/third_party/brotli/dec/streams.c
+++ b/third_party/brotli/dec/streams.c
@@ -51,8 +51,9 @@ BrotliInput BrotliInitMemInput(const uint8_t* buffer, size_t length,
int BrotliMemOutputFunction(void* data, const uint8_t* buf, size_t count) {
BrotliMemOutput* output = (BrotliMemOutput*)data;
- if (output->pos + count > output->length) {
- return -1;
+ size_t limit = output->length - output->pos;
+ if (count > limit) {
+ count = limit;
}
memcpy(output->buffer + output->pos, buf, count);
output->pos += count;
« no previous file with comments | « third_party/brotli/dec/state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698