mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
AK+LibCompress: Break when seekback copying to a full CircularBuffer
Otherwise, we just end up infinitely looping while waiting for more space in the destination.
This commit is contained in:
parent
767fb01a8c
commit
b88c58b94c
Notes:
sideshowbarker
2024-07-16 21:55:16 +09:00
Author: https://github.com/timschumi
Commit: b88c58b94c
Pull-request: https://github.com/SerenityOS/serenity/pull/18180
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/trflynn89 ✅
2 changed files with 7 additions and 1 deletions
|
@ -213,6 +213,9 @@ ErrorOr<size_t> CircularBuffer::copy_from_seekback(size_t distance, size_t lengt
|
|||
|
||||
auto remaining_length = length;
|
||||
while (remaining_length > 0) {
|
||||
if (empty_space() == 0)
|
||||
break;
|
||||
|
||||
auto next_span = next_read_span_with_seekback(distance);
|
||||
if (next_span.size() == 0)
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue