[Scummvm-tracker] [ScummVM :: Bugs] #17277: GUI: Some mactext canvas surfaces are used before fully initialized

ScummVM :: Bugs trac at scummvm.org
Sun Oct 4 18:13:06 UTC 2026


#17277: GUI: Some mactext canvas surfaces are used before fully initialized
--------------------------+--------------------
Reporter:  tunnelsociety  |      Owner:  (none)
    Type:  defect         |     Status:  new
Priority:  low            |  Component:  GUI
 Version:                 |   Keywords:
    Game:                 |
--------------------------+--------------------
 Hi!
 ubsan reports something when during gameplay, in GMM (Ctrl+F5), I click
 the Help button.

 It looks like in `MacTextCanvas::render(int, int)` the `_glyphMask` and
 `_charBoxMask` have null `pixels`. (`Surface::getBasePtr()` returns `0x1`
 instead of a useful address.) I did only a little reading and didn't
 figure out where those pixels should be initialized.

 {{{
 graphics/surface.h:153:50: runtime error: applying non-zero offset 1 to
 null pointer

 (gdb) bt
 [...]
 #4  0x0000555558d9e914 in Graphics::MacTextCanvas::render
 (this=0x51d000111528, from=0, to=31, target=0x50b00008f300, fillColor=255,
     bboxesOnly=false) at graphics/macgui/mactext-canvas.cpp:683
 #5  0x0000555558da3ec1 in Graphics::MacTextCanvas::render
 (this=0x51d000111528, from=0, to=31) at graphics/macgui/mactext-
 canvas.cpp:792
 #6  0x0000555558ce721a in Graphics::MacText::render (this=0x51d000111280)
 at graphics/macgui/mactext.cpp:664
 #7  0x0000555558d282b7 in Graphics::MacText::setText (this=0x51d000111280,
 str=...) at graphics/macgui/mactext.cpp:2037
 #8  0x0000555558dbf38e in Graphics::MacText::setMarkdownText
 (this=0x51d000111280, str=...) at graphics/macgui/mactext-md.cpp:379
 #9  0x000055555877e51d in GUI::RichTextWidget::createWidget
 (this=0x5160001f1a80) at gui/widgets/richtext.cpp:348
 #10 0x00005555587826d5 in GUI::RichTextWidget::ensureWidget
 (this=0x5160001f1a80) at gui/widgets/richtext.cpp:398
 #11 0x00005555587828dd in GUI::RichTextWidget::drawWidget
 (this=0x5160001f1a80) at gui/widgets/richtext.cpp:402
 #12 0x00005555586787ca in GUI::Widget::draw (this=0x5160001f1a80) at
 gui/widget.cpp:119
 #13 0x0000555558784bae in GUI::RichTextWidget::draw (this=0x5160001f1a80)
 at gui/widgets/richtext.cpp:433
 #14 0x0000555558678c0d in GUI::Widget::draw (this=0x513000061b00) at
 gui/widget.cpp:130
 #15 0x00005555587aad5e in GUI::TabWidget::draw (this=0x513000061b00) at
 gui/widgets/tab.cpp:421
 #16 0x00005555583cae18 in GUI::Dialog::drawWidgets (this=0x7ffff4d69670)
 at gui/dialog.cpp:204
 }}}

 version:
 {{{
 ScummVM 2026.3.1git10807-g666cee41f63-dirty (Oct  4 2026 13:53:00)
 Using SDL backend with SDL 3.2.10
 Features compiled in: Vorbis ALSA sndio RGB zLib FreeType2 PNG GIF SDL3
 OpenGL
 }}}
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/17277>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list