We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60746df commit 343d270Copy full SHA for 343d270
chromium/cc/paint/paint_op_reader.cc
@@ -1572,9 +1572,10 @@ inline void PaintOpReader::DidRead(size_t bytes_read) {
1572
// All data are aligned with PaintOpWriter::kDefaultAlignment at least.
1573
size_t aligned_bytes =
1574
base::bits::AlignUp(bytes_read, PaintOpWriter::kDefaultAlignment);
1575
- memory_ += aligned_bytes;
1576
DCHECK_LE(aligned_bytes, remaining_bytes_);
1577
- remaining_bytes_ -= aligned_bytes;
+ bytes_read = std::min(aligned_bytes, remaining_bytes_);
+ memory_ += bytes_read;
1578
+ remaining_bytes_ -= bytes_read;
1579
}
1580
1581
} // namespace cc
0 commit comments