Changeset 8154


Ignore:
Timestamp:
05/05/11 17:24:29 (14 years ago)
Author:
Mathieu Morlighem
Message:

Added check on sizes to avoid seg faults

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp

    r6412 r8154  
    130130                        j2= (int)ceil((x_tria_max-x_grid_min)/xposting);
    131131                }
     132                /*Check indices*/
     133                if(i1<0)      _error_("first index is 0!");
     134                if(j1<0)      _error_("first index is 0!");
     135                if(i2>=nlines)_error_("index exceeds matrix dimension! (%i >= nlines  %i)",i2,nlines);
     136                if(j2>=ncols) _error_("index exceeds matrix dimension! (%i >= ncols   %i)",j2,ncols);
    132137
    133138                /*get area of the current element (Jacobian = 2 * area)*/
Note: See TracChangeset for help on using the changeset viewer.