| Index: third_party/brotli/dec/decode.c
|
| diff --git a/third_party/brotli/dec/decode.c b/third_party/brotli/dec/decode.c
|
| index bd0d2132d8f57a70b9979fd08cbe4dcf1c8eeedd..f0bb469d024250235be22eb5fd770e6b7c29a3cb 100644
|
| --- a/third_party/brotli/dec/decode.c
|
| +++ b/third_party/brotli/dec/decode.c
|
| @@ -1672,6 +1672,10 @@ postReadDistance:
|
| uint8_t* copy_src = &s->ringbuffer[
|
| (pos - s->distance_code) & s->ringbuffer_mask];
|
| uint8_t* copy_dst = &s->ringbuffer[pos];
|
| + /* Check for possible underflow and clamp the pointer to 0. */
|
| + if (PREDICT_FALSE(s->ringbuffer_end < (const uint8_t*)0 + i)) {
|
| + ringbuffer_end_minus_copy_length = 0;
|
| + }
|
| /* update the recent distances cache */
|
| s->dist_rb[s->dist_rb_idx & 3] = s->distance_code;
|
| ++s->dist_rb_idx;
|
|
|