File tree Expand file tree Collapse file tree
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget
Generals/Code/GameEngine/Source/GameClient/GUI/Gadget Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,6 +197,14 @@ static Int getListboxBottomEntry( ListboxData *list )
197197{
198198 Int entry;
199199
200+ // Safety checks to prevent access violations during screen transitions
201+ if ( list == NULL )
202+ return 0 ;
203+ if ( list->listData == NULL )
204+ return 0 ;
205+ if ( list->endPos <= 0 )
206+ return 0 ;
207+
200208 // determine which entry is at the top of the display area
201209 for ( entry=list->endPos - 1 ; ; entry-- )
202210 {
Original file line number Diff line number Diff line change @@ -197,6 +197,14 @@ static Int getListboxBottomEntry( ListboxData *list )
197197{
198198 Int entry;
199199
200+ // Safety checks to prevent access violations during screen transitions
201+ if ( list == NULL )
202+ return 0 ;
203+ if ( list->listData == NULL )
204+ return 0 ;
205+ if ( list->endPos <= 0 )
206+ return 0 ;
207+
200208 // determine which entry is at the top of the display area
201209 for ( entry=list->endPos - 1 ; ; entry-- )
202210 {
You can’t perform that action at this time.
0 commit comments