diff --git a/Outputs/CRT/Internals/CRTInputBufferBuilder.cpp b/Outputs/CRT/Internals/CRTInputBufferBuilder.cpp index 9cc3eae84..ebf36ae4b 100644 --- a/Outputs/CRT/Internals/CRTInputBufferBuilder.cpp +++ b/Outputs/CRT/Internals/CRTInputBufferBuilder.cpp @@ -53,9 +53,9 @@ void CRTInputBufferBuilder::reduce_previous_allocation_to(size_t actual_length) uint8_t *const image_pointer = _image.get(); // correct if the writing cursor was reset while a client was writing - if(_next_write_x_position == 0 && _next_write_y_position == 0 && _write_target_pointer != 1) + if(_next_write_x_position == 0 && _next_write_y_position == 0) { - memmove(&image_pointer[1], &image_pointer[_write_target_pointer], actual_length); + memmove(&image_pointer[1], &image_pointer[_write_target_pointer], actual_length * _bytes_per_pixel); _write_target_pointer = 1; _last_allocation_amount = actual_length; _next_write_x_position = (uint16_t)(actual_length + 2);