streaming/buffer: fix buf_offset getting out of sync

During consolidation of regions, buf_offset could get out of sync if
the region was grown on the left side.

To fix, reset it and let "sbb slide" logic correct it.

Bug: #6117.
pull/8990/head
Victor Julien 2 years ago
parent e69583da54
commit f06a0ee836

@ -1201,7 +1201,11 @@ static StreamingBufferRegion *BufferInsertAtRegionConsolidate(StreamingBuffer *s
DEBUG_VALIDATE_BUG_ON(dst_size != dst->buf_size);
if (dst_copy_offset != 0)
memmove(dst->buf + dst_copy_offset, dst->buf, old_size);
dst->stream_offset = dst_offset;
if (dst_offset != dst->stream_offset) {
dst->stream_offset = dst_offset;
// buf_offset no longer valid, reset.
dst->buf_offset = 0;
}
uint32_t new_offset = src_start->buf_offset;
if (data_offset == src_start->stream_offset + src_start->buf_offset) {

Loading…
Cancel
Save