mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 23:39:20 +00:00
QoL and bug fixes
This commit is contained in:
@ -50,7 +50,7 @@ namespace Video
|
||||
|
||||
size_t Size = this->framebuffer.Pitch * Height;
|
||||
|
||||
this->Buffers[Index].Buffer = KernelAllocator.RequestPages(TO_PAGES(Size));
|
||||
this->Buffers[Index].Buffer = KernelAllocator.RequestPages(TO_PAGES(Size + 1));
|
||||
memset(this->Buffers[Index].Buffer, 0, Size);
|
||||
|
||||
this->Buffers[Index].Width = Width;
|
||||
@ -102,7 +102,7 @@ namespace Video
|
||||
return;
|
||||
}
|
||||
|
||||
KernelAllocator.FreePages(this->Buffers[Index].Buffer, TO_PAGES(this->Buffers[Index].Size));
|
||||
KernelAllocator.FreePages(this->Buffers[Index].Buffer, TO_PAGES(this->Buffers[Index].Size + 1));
|
||||
this->Buffers[Index].Buffer = nullptr;
|
||||
this->Buffers[Index].Checksum = 0;
|
||||
debug("Buffer %d deleted", Index);
|
||||
|
@ -33,7 +33,7 @@ namespace Video
|
||||
{
|
||||
this->Info.PSF2Font = new PSF2_FONT;
|
||||
|
||||
PSF2_HEADER *font2 = (PSF2_HEADER *)KernelAllocator.RequestPages(FontDataLength / PAGE_SIZE + 1);
|
||||
PSF2_HEADER *font2 = (PSF2_HEADER *)KernelAllocator.RequestPages(TO_PAGES(FontDataLength + 1));
|
||||
memcpy((void *)font2, Start, FontDataLength);
|
||||
|
||||
Memory::Virtual().Map((void *)font2, (void *)font2, FontDataLength, Memory::PTFlag::RW);
|
||||
@ -41,7 +41,7 @@ namespace Video
|
||||
if (font2->magic[0] != PSF2_MAGIC0 || font2->magic[1] != PSF2_MAGIC1 || font2->magic[2] != PSF2_MAGIC2 || font2->magic[3] != PSF2_MAGIC3)
|
||||
{
|
||||
error("Font2 magic mismatch.");
|
||||
KernelAllocator.FreePages((void *)font2, FontDataLength / PAGE_SIZE + 1);
|
||||
KernelAllocator.FreePages((void *)font2, TO_PAGES(FontDataLength + 1));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user