- Fixed a possible uninitialized condition.

In the function R_RebuildViewInterpolation, the pointer 'iview' was not initialized when the player or its camera were NULL, hence 'iview == NULL' was garbage. Also, the function FindPastViewer does not return NULL, hence the mentioned check is not needed at all. Just return early if the player camera does not exist.
This commit is contained in:
Edoardo Prezioso 2014-09-26 10:52:11 +02:00
parent 0f62983aee
commit 54ccf5d44d

View file

@ -737,24 +737,20 @@ void R_ClearPastViewer (AActor *actor)
void R_RebuildViewInterpolation(player_t *player) void R_RebuildViewInterpolation(player_t *player)
{ {
InterpolationViewer *iview; if (player == NULL || player->camera == NULL)
if (NoInterpolateView) return;
{
if (player != NULL && player->camera != NULL)
{
iview = FindPastViewer(player->camera);
}
if (iview == NULL) if (!NoInterpolateView)
return; return;
NoInterpolateView = false;
NoInterpolateView = false; InterpolationViewer *iview = FindPastViewer(player->camera);
iview->oviewx = iview->nviewx;
iview->oviewy = iview->nviewy; iview->oviewx = iview->nviewx;
iview->oviewz = iview->nviewz; iview->oviewy = iview->nviewy;
iview->oviewpitch = iview->nviewpitch; iview->oviewz = iview->nviewz;
iview->oviewangle = iview->nviewangle; iview->oviewpitch = iview->nviewpitch;
} iview->oviewangle = iview->nviewangle;
} }
//========================================================================== //==========================================================================