[MPlayer-cvslog] r33194 - in trunk/gui/mplayer: mw.c pb.c

ib subversion at mplayerhq.hu
Sun Apr 3 16:24:36 CEST 2011


Author: ib
Date: Sun Apr  3 16:24:36 2011
New Revision: 33194

Log:
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.

Modified:
   trunk/gui/mplayer/mw.c
   trunk/gui/mplayer/pb.c

Modified: trunk/gui/mplayer/mw.c
==============================================================================
--- trunk/gui/mplayer/mw.c	Sun Apr  3 12:54:03 2011	(r33193)
+++ trunk/gui/mplayer/mw.c	Sun Apr  3 16:24:36 2011	(r33194)
@@ -437,8 +437,11 @@ void mplMainMouseHandle( int Button,int 
           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;

Modified: trunk/gui/mplayer/pb.c
==============================================================================
--- trunk/gui/mplayer/pb.c	Sun Apr  3 12:54:03 2011	(r33193)
+++ trunk/gui/mplayer/pb.c	Sun Apr  3 16:24:36 2011	(r33194)
@@ -161,8 +161,11 @@ static void mplPBMouseHandle( int Button
 
 	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;


More information about the MPlayer-cvslog mailing list