Opened 13 years ago

Closed 12 years ago

Last modified 6 years ago

#5935 closed defect (fixed)

LAUNCHER: Assertion on MIDI gain slider

Reported by: raziel- Owned by: sev-
Priority: normal Component: GUI
Version: Keywords:
Cc: Game:

Description

ScummVM 1.5.0git (Dec 28 2011 17:13:06) Features compiled in: Vorbis FLAC MP3 RGB zLib Theora AAC

Launcher / Options / MIDI Moving the "MIDI gain" slider to the left (lowering the gain) results in an

assertion "idx >= 0 && (unt)idx < _size" failed: file "./common/array.h", line 155

on reaching the value "0.23" (at least that is where the assertion locked up ScummVM for me)

AmigaOS4 - PPC - SDL - BE gcc (GCC) 4.2.4 (adtools build 20090118)

Ticket imported from: #3466536. Ticket imported from: bugs/5935.

Change History (8)

comment:1 by digitall, 13 years ago

I can replicate this as well with Linux x86_32 with latest Git master, so this is not BE specific: scummvm: ./common/array.h:155: T& Common::Array<T>::operator[](int) [with T = int]: Assertion `idx >= 0 && (uint)idx < _size' failed. Aborted

I'll try and bisect to see when this bug started occurring.

comment:2 by digitall, 13 years ago

This bug was introduced by the following commit: Commit 71d6771be5911f533e4747156ea15be72502a42c Author: Eugene Sandulenko <sev@scummvm.org> Date: Wed Dec 14 00:55:18 2011 +0000

GUI: Implement dithering for tabs and round squares

comment:3 by digitall, 13 years ago

Owner: set to sev-

comment:4 by digitall, 13 years ago

The relevant backtrace is as follows: #4 0x08098e79 in Common::Array<int>::operator[] (this=0x83698d8, idx=20) at ./common/array.h:155 #5 0x080ce385 in Graphics::VectorRendererSpec<unsigned short>::gradientFill ( this=0x8369880, ptr=0x8478450, width=2, x=164, y=19) at graphics/VectorRendererSpec.cpp:292 #6 0x080cddb3 in Graphics::VectorRendererSpec<unsigned short>::drawRoundedSquareAlg (this=0x8369880, x1=164, y1=239, r=0, w=1, h=18, color=0, fill_m=Graphics::VectorRenderer::kFillGradient) at graphics/VectorRendererSpec.cpp:1441 #7 0x080c840d in Graphics::VectorRendererSpec<unsigned short>::drawRoundedSquare (this=0x8369880, x=164, y=239, r=0, w=1, h=18) at graphics/VectorRendererSpec.cpp:695 #8 0x0808f8c7 in Graphics::VectorRenderer::drawCallback_ROUNDSQ (this= 0x8369880, area=..., step=...) at ./graphics/VectorRenderer.h:373 #9 0x080c6c4a in Graphics::VectorRenderer::drawStep (this=0x8369880, area=..., step=..., extra=0) at graphics/VectorRenderer.cpp:58 #10 0x080792c5 in GUI::ThemeItemDrawData::drawSelf (this=0x84a7cb0, draw=true, restore=false) at gui/ThemeEngine.cpp:224 #11 0x0807b333 in GUI::ThemeEngine::queueDD (this=0x83672f0, ---Type <return> to continue, or q <return> to quit--- type=GUI::kDDSliderHover, r=..., dynamic=0, restore=false) at gui/ThemeEngine.cpp:816 #12 0x0807bab6 in GUI::ThemeEngine::drawSlider (this=0x83672f0, r=..., width=1, state=GUI::ThemeEngine::kStateHighlight) at gui/ThemeEngine.cpp:953 #13 0x0809407f in GUI::SliderWidget::drawWidget (this=0x84a55a0) at gui/widget.cpp:540 #14 0x0809222f in GUI::Widget::draw (this=0x84a55a0) at gui/widget.cpp:105 #15 0x08093e16 in GUI::SliderWidget::handleMouseMoved (this=0x84a55a0, x=2, y=19, button=0) at gui/widget.cpp:501 #16 0x0805dcd9 in GUI::Dialog::handleMouseMoved (this=0xbfffe1b4, x=143, y=145, button=0) at gui/dialog.cpp:300 #17 0x0805ed52 in GUI::GuiManager::runLoop (this=0x835d8b0) at gui/gui-manager.cpp:341 #18 0x0805d331 in GUI::Dialog::runModal (this=0xbfffe1b4) at gui/dialog.cpp:71 #19 0x0806671b in GUI::LauncherDialog::handleCommand (this=0xbfffe598, sender=0x838dc70, cmd=1330664526, data=0) at gui/launcher.cpp:1004 #20 0x08067365 in GUI::CommandSender::sendCommand (this=0x838dc70, cmd=1330664526, data=0) at ./gui/object.h:53 #21 0x08092c89 in GUI::ButtonWidget::handleMouseUp (this=0x838dc00, x=24, y=9, button=1, clickCount=1) at gui/widget.cpp:295 #22 0x0805d7d0 in GUI::Dialog::handleMouseUp (this=0xbfffe598, x=533, y=290, button=1, clickCount=1) at gui/dialog.cpp:195

comment:5 by digitall, 13 years ago

Commited fix for crash as 6a2522a1423b23ef14dbc5e317befd4f3a800020, but:

GRAPHICS: Crash fix for bug #3466536 ("Assertion on MIDI gain slider").

This fixes the crash, but the Midi Gain slider (and probably any other slider bar in modern theme) still distorts the left corner shape when the slider thumb is at very small values...

Further modifications are needed to correct the drawRoundedCorner at small values...

comment:6 by sev-, 12 years ago

Resolution: fixed
Status: newclosed

comment:7 by sev-, 12 years ago

The rounding corner code was recently rewritten and this bug is now gone. The slight distortion is still in place, but at least now it is at acceptable level.

comment:8 by digitall, 6 years ago

Component: GUI
Note: See TracTickets for help on using tickets.