diff options
author | Robert Göffringmann | 2005-11-21 18:21:44 +0000 |
---|---|---|
committer | Robert Göffringmann | 2005-11-21 18:21:44 +0000 |
commit | 619f0fa5a0ce89b4345619a53d9d07d6d229c951 (patch) | |
tree | 83a234cb266ff9cc346305138c1985e69b4f5827 /sky | |
parent | 9a09283a76a4887551db7224a1bac2f4a4d3d43b (diff) | |
download | scummvm-rg350-619f0fa5a0ce89b4345619a53d9d07d6d229c951.tar.gz scummvm-rg350-619f0fa5a0ce89b4345619a53d9d07d6d229c951.tar.bz2 scummvm-rg350-619f0fa5a0ce89b4345619a53d9d07d6d229c951.zip |
fixed segmentation fault when speed/volume sliders are clicked and then dragged out of the scummvm window.
svn-id: r19683
Diffstat (limited to 'sky')
-rw-r--r-- | sky/control.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sky/control.cpp b/sky/control.cpp index d94ba02cc6..b10809fda4 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -332,7 +332,8 @@ void Control::buttonControl(ConResource *pButton) { return; } if (_curButtonText != pButton->_text) { - if (_textSprite) free(_textSprite); + if (_textSprite) + free(_textSprite); _textSprite = NULL; _curButtonText = pButton->_text; if (pButton->_text) { @@ -345,9 +346,11 @@ void Control::buttonControl(ConResource *pButton) { } _textSprite = (dataFileHeader *)textRes.textData; _text->setSprite(_textSprite); - } else _text->setSprite(NULL); + } else + _text->setSprite(NULL); } - _text->setXY(_mouseX + 12, _mouseY - 16); + int destY = (_mouseY - 16 >= 0) ? _mouseY - 16 : 0; + _text->setXY(_mouseX + 12, destY); } void Control::drawTextCross(uint32 flags) { |