# HG changeset patch # User ib # Date 1301840676 0 # Node ID eda3df3e4a9d5f45e5029d8056eb6c3932e11687 # Parent e9e5ee3a1a826ad8aabcad83535f98c5f452ff97 Prevent an out-of-bounds array access. This out-of-bounds array access was of not much effect until r33190, because the variables falsely changed (set to 1) were either almost always unused (the last member of the mainItems array) or variable menuIsPresent which only has effect if there is a menu present (in which case it is set anyway). With r33190 the wItem (and thus the guiItems) structure size changed and now variables were accessed whose changings have visible effect. After releasing the moved main (or playbar) window, the IndexOfItems values got destroyed and items disappeared. diff -r e9e5ee3a1a82 -r eda3df3e4a9d gui/mplayer/mw.c --- a/gui/mplayer/mw.c Sun Apr 03 10:54:03 2011 +0000 +++ b/gui/mplayer/mw.c Sun Apr 03 14:24:36 2011 +0000 @@ -437,8 +437,11 @@ break; case wsRLMouseButton: boxMoved=0; + if ( SelectedItem != -1 ) // NOTE TO MYSELF: only if itButton, itHPotmeter or itVPotmeter + { item=&appMPlayer.mainItems[SelectedItem]; item->pressed=btnReleased; + } SelectedItem=-1; if ( currentselected == - 1 ) { itemtype=0; break; } value=0; diff -r e9e5ee3a1a82 -r eda3df3e4a9d gui/mplayer/pb.c --- a/gui/mplayer/pb.c Sun Apr 03 10:54:03 2011 +0000 +++ b/gui/mplayer/pb.c Sun Apr 03 14:24:36 2011 +0000 @@ -161,8 +161,11 @@ break; case wsRLMouseButton: + if ( SelectedItem != -1 ) // NOTE TO MYSELF: only if itButton, itHPotmeter or itVPotmeter + { item=&appMPlayer.barItems[SelectedItem]; item->pressed=btnReleased; + } SelectedItem=-1; if ( currentselected == - 1 ) { itemtype=0; break; } value=0;