git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12109
d7cf8633-e32d-0410-b094-
e92efae38249
MSG_ReadVector(&cl_message, pos, cls.protocol);
MSG_ReadVector(&cl_message, pos, cls.protocol);
- if (sound_num >= MAX_SOUNDS)
+ if (sound_num < 0 || sound_num >= MAX_SOUNDS)
{
Con_Printf("CL_ParseStartSoundPacket: sound_num (%i) >= MAX_SOUNDS (%i)\n", sound_num, MAX_SOUNDS);
return;
{
Con_Printf("CL_ParseStartSoundPacket: sound_num (%i) >= MAX_SOUNDS (%i)\n", sound_num, MAX_SOUNDS);
return;
sound_num = (unsigned short) MSG_ReadShort(&cl_message);
else
sound_num = MSG_ReadByte(&cl_message);
sound_num = (unsigned short) MSG_ReadShort(&cl_message);
else
sound_num = MSG_ReadByte(&cl_message);
+
+ if (sound_num < 0 || sound_num >= MAX_SOUNDS)
+ {
+ Con_Printf("CL_ParseStaticSound: sound_num(%i) >= MAX_SOUNDS (%i)\n", sound_num, MAX_SOUNDS);
+ return;
+ }
+
vol = MSG_ReadByte(&cl_message);
atten = MSG_ReadByte(&cl_message);
vol = MSG_ReadByte(&cl_message);
atten = MSG_ReadByte(&cl_message);
#ifndef USE_GLES2
// disable video-only stipple
if (qglPolygonStipple && !scr_stipple.integer && cl_video_stipple.integer)
#ifndef USE_GLES2
// disable video-only stipple
if (qglPolygonStipple && !scr_stipple.integer && cl_video_stipple.integer)
qglDisable(GL_POLYGON_STIPPLE);CHECKGLERROR
qglDisable(GL_POLYGON_STIPPLE);CHECKGLERROR
#endif
// VorteX: draw subtitle_text
#endif
// VorteX: draw subtitle_text
{
// arg contains whitespace, store quotes around it
com_cmdline[n++] = '\"';
{
// arg contains whitespace, store quotes around it
com_cmdline[n++] = '\"';
- while ((n < ((int)sizeof(com_cmdline) - 1)) && com_argv[j][i])
+ while ((n < ((int)sizeof(com_cmdline) - 2)) && com_argv[j][i])
com_cmdline[n++] = com_argv[j][i++];
com_cmdline[n++] = '\"';
}
com_cmdline[n++] = com_argv[j][i++];
com_cmdline[n++] = '\"';
}
// recurse front side first because the svbsp building prefers it
if (info->relativelightorigin[plane->type] >= plane->dist)
{
// recurse front side first because the svbsp building prefers it
if (info->relativelightorigin[plane->type] >= plane->dist)
{
- if (nodestackpos < GETLIGHTINFO_MAXNODESTACK)
+ if (nodestackpos < GETLIGHTINFO_MAXNODESTACK-1)
nodestack[nodestackpos++] = node->children[0];
nodestack[nodestackpos++] = node->children[1];
}
else
{
nodestack[nodestackpos++] = node->children[0];
nodestack[nodestackpos++] = node->children[1];
}
else
{
- if (nodestackpos < GETLIGHTINFO_MAXNODESTACK)
+ if (nodestackpos < GETLIGHTINFO_MAXNODESTACK-1)
nodestack[nodestackpos++] = node->children[1];
nodestack[nodestackpos++] = node->children[0];
}
nodestack[nodestackpos++] = node->children[1];
nodestack[nodestackpos++] = node->children[0];
}
// recurse front side first because the svbsp building prefers it
if (PlaneDist(info->relativelightorigin, plane) >= 0)
{
// recurse front side first because the svbsp building prefers it
if (PlaneDist(info->relativelightorigin, plane) >= 0)
{
- if (nodestackpos < GETLIGHTINFO_MAXNODESTACK)
+ if (nodestackpos < GETLIGHTINFO_MAXNODESTACK-1)
nodestack[nodestackpos++] = node->children[0];
nodestack[nodestackpos++] = node->children[1];
}
else
{
nodestack[nodestackpos++] = node->children[0];
nodestack[nodestackpos++] = node->children[1];
}
else
{
- if (nodestackpos < GETLIGHTINFO_MAXNODESTACK)
+ if (nodestackpos < GETLIGHTINFO_MAXNODESTACK-1)
nodestack[nodestackpos++] = node->children[1];
nodestack[nodestackpos++] = node->children[0];
}
nodestack[nodestackpos++] = node->children[1];
nodestack[nodestackpos++] = node->children[0];
}
#endif
if (info->lightmins[axis] <= node->backmax)
{
#endif
if (info->lightmins[axis] <= node->backmax)
{
- if (info->lightmaxs[axis] >= node->frontmin && nodestackpos < GETLIGHTINFO_MAXNODESTACK)
+ if (info->lightmaxs[axis] >= node->frontmin && nodestackpos < GETLIGHTINFO_MAXNODESTACK-1)
nodestack[nodestackpos++] = node->front;
nodestack[nodestackpos++] = node->back;
continue;
nodestack[nodestackpos++] = node->front;
nodestack[nodestackpos++] = node->back;
continue;