--- nono/vm/lunafb.cpp 2026/04/29 17:05:37 1.1.1.8 +++ nono/vm/lunafb.cpp 2026/04/29 17:05:42 1.1.1.9 @@ -66,6 +66,10 @@ LunafbDevice::~LunafbDevice() bool LunafbDevice::Init() { + if (inherited::Init() == false) { + return false; + } + auto bt45x = GetBT45xDevice(); nplane = bt45x->GetPlaneCount(); @@ -73,7 +77,12 @@ LunafbDevice::Init() fcset_end = fcset0base + 0x40000 * nplane; // プレーン数によってメモリを確保 - mem.reset(new uint8 [0x40000 * nplane]); + size_t memsize = 0x40000 * nplane; + mem.reset(new(std::nothrow) uint8 [memsize]); + if ((bool)mem == false) { + warnx("Cannot allocate %zu bytes at %s", memsize, __method__); + return false; + } // ホストパレットを取得。 palette = &(bt45x->GetHostPalette())[0];