]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid accessing invalid elements of an array.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 1 Jul 2011 14:36:09 +0000 (14:36 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 1 Jul 2011 14:36:09 +0000 (14:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@23904 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/grid/grid_in.cc

index f789b78f0b86d56ac31c30bb3823b9a177b66c39..8579f3d731b3dd5a6e1599c5555a65125c13eb3b 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -1666,7 +1666,7 @@ void GridIn<2>::read_tecplot (std::istream &in)
          if (next_index==dim && structured)
            break;
 
-         if (i==tecplot2deal[next_index])
+         if ((next_index<dim) && (i==tecplot2deal[next_index]))
            {
                                               // we need this line, read it in
              for (unsigned int j=1; j<n_vertices+1; ++j)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.