Kernel: Use the correct bpp when writing to framebuffer

This commit is contained in:
Bananymous 2023-11-29 00:31:24 +02:00
parent 056586486d
commit d7a3aca5d4
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ namespace Kernel
if ((size_t)offset >= m_width * m_height * bytes_per_pixel_internal)
return 0;
size_t bytes_to_copy = BAN::Math::min<size_t>(m_width * m_height * 3 - offset, buffer.size());
size_t bytes_to_copy = BAN::Math::min<size_t>(m_width * m_height * bytes_per_pixel_internal - offset, buffer.size());
memcpy(reinterpret_cast<void*>(m_video_buffer->vaddr() + offset), buffer.data(), bytes_to_copy);
uint32_t first_pixel = offset / bytes_per_pixel_internal;