Browse Source

Add assertion to GeoMipTerrain::get_block_node_path

rdb 10 years ago
parent
commit
c85a92d378
1 changed files with 3 additions and 0 deletions
  1. 3 0
      panda/src/grutil/geoMipTerrain.I

+ 3 - 0
panda/src/grutil/geoMipTerrain.I

@@ -385,8 +385,11 @@ get_flatten_mode() {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const NodePath GeoMipTerrain::
 INLINE const NodePath GeoMipTerrain::
 get_block_node_path(unsigned short mx, unsigned short my) {
 get_block_node_path(unsigned short mx, unsigned short my) {
+  nassertr(mx < _blocks.size(), NodePath::fail());
+  nassertr(my < _blocks[mx].size(), NodePath::fail());
   return _blocks[mx][my];
   return _blocks[mx][my];
 }
 }
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: GeoMipTerrain::get_block_from_pos
 //     Function: GeoMipTerrain::get_block_from_pos
 //       Access: Published
 //       Access: Published