switchbrew / libnx

Library for Switch Homebrew

Home Page:https://switchbrew.github.io/libnx/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linear framebuffer crashes on certain dimensions

averne opened this issue · comments

The following code results in a data abort (fatal error 2168-0002). It seems to trigger a heap corruption during linear -> block linear conversion?
Regular dimensions such as 1280x720 work as expected.

#include <switch.h>

#define FB_WIDTH  256
#define FB_HEIGHT 256

int main() {
    Framebuffer fb;
    framebufferCreate(&fb, nwindowGetDefault(),
        FB_WIDTH, FB_HEIGHT, PIXEL_FORMAT_RGBA_8888, 2);
    framebufferMakeLinear(&fb);

    framebufferBegin(&fb, NULL);
    framebufferEnd(&fb);

    framebufferClose(&fb);
    return 0;
}
commented

This was a long standing known bug, the cause of which has finally been found and fixed. Thanks for your report.

Nice, thanks for the fix