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 4f90911 commit 5af5e96Copy full SHA for 5af5e96
chromium/cc/paint/paint_op_reader.cc
@@ -1532,9 +1532,10 @@ inline void PaintOpReader::DidRead(size_t bytes_read) {
1532
// All data are aligned with PaintOpWriter::kDefaultAlignment at least.
1533
size_t aligned_bytes =
1534
base::bits::AlignUp(bytes_read, PaintOpWriter::kDefaultAlignment);
1535
- memory_ += aligned_bytes;
1536
DCHECK_LE(aligned_bytes, remaining_bytes_);
1537
- remaining_bytes_ -= aligned_bytes;
+ bytes_read = std::min(aligned_bytes, remaining_bytes_);
+ memory_ += bytes_read;
1538
+ remaining_bytes_ -= bytes_read;
1539
}
1540
1541
} // namespace cc
0 commit comments