]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
added more validation of clipnodes loaded from a q1bsp file
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 23 Mar 2006 02:34:16 +0000 (02:34 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 23 Mar 2006 02:34:16 +0000 (02:34 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6169 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index eded31a162e22c5c6b178c8b91911512ac3df13f..53eb3ff0b82b9c0b24feb266a5227b707bdc7384 100644 (file)
@@ -2349,6 +2349,8 @@ static void Mod_Q1BSP_LoadClipnodes(lump_t *l, hullinfo_t *hullinfo)
                out->planenum = LittleLong(in->planenum);
                out->children[0] = LittleShort(in->children[0]);
                out->children[1] = LittleShort(in->children[1]);
+               if (out->planenum < 0 || out->planenum >= loadmodel->brush.num_planes)
+                       Host_Error("Corrupt clipping hull(out of range planenum)");
                if (out->children[0] >= count || out->children[1] >= count)
                        Host_Error("Corrupt clipping hull(out of range child)");
        }