Skip to content

Commit

Permalink
Fixed|Client: A number of issues discovered in static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Apr 20, 2014
1 parent 7fbc222 commit 34ff341
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doomsday/client/src/audio/s_mus.cpp
Expand Up @@ -229,7 +229,7 @@ int Mus_GetExt(ded_music_t *def, ddstring_t *retPath)
{
LOG_AS("Mus_GetExt");

if(!musAvail || !AudioDriver_Music_Available()) return false;
if(!musAvail || !AudioDriver_Music_Available() || !def) return false;

if(def->path && !Str_IsEmpty(Uri_Path(def->path)))
{
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/gl/dgl_common.cpp
Expand Up @@ -454,7 +454,7 @@ dd_bool DGL_GetIntegerv(int name, int *v)
#undef DGL_GetInteger
int DGL_GetInteger(int name)
{
int values[10];
int values[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
DGL_GetIntegerv(name, values);
return values[0];
}
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/src/gl/gl_tex.cpp
Expand Up @@ -312,6 +312,7 @@ static void* packImage(int components, const float* tempOut, GLint typeOut,
break;
}
default:
DENG_ASSERT(!"packImage: Unknown output type");
return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions doomsday/client/src/render/rend_main.cpp
Expand Up @@ -980,6 +980,8 @@ static void quadShinyTexCoords(Vector2f *tc, Vector3f const *topLeft,

static void flatShinyTexCoords(Vector2f *tc, Vector3f const &point)
{
DENG_ASSERT(tc);

// Determine distance to viewer.
float distToEye = Vector2f(vOrigin.x - point.x, vOrigin.z - point.y)
.normalize().length();
Expand Down
2 changes: 2 additions & 0 deletions doomsday/client/src/world/maputil.cpp
Expand Up @@ -263,6 +263,8 @@ static bool middleMaterialCoversOpening(LineSide const &side)
Line *R_FindSolidLineNeighbor(Sector const *sector, Line const *line,
LineOwner const *own, bool antiClockwise, binangle_t *diff)
{
DENG_ASSERT(sector);

LineOwner const *cown = antiClockwise? &own->prev() : &own->next();
Line *other = &cown->line();

Expand Down

0 comments on commit 34ff341

Please sign in to comment.