]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add error checks
authorTimo Heister <timo.heister@gmail.com>
Thu, 7 Jul 2022 18:37:59 +0000 (14:37 -0400)
committerTimo Heister <timo.heister@gmail.com>
Thu, 7 Jul 2022 18:40:39 +0000 (14:40 -0400)
source/base/data_out_base.cc

index 1e4339bb02037a9ffacecd28870414458597bf55..bc0710b3dfdcce7a1f9d5c81070ee4d1c78ef3c7 100644 (file)
@@ -9255,6 +9255,14 @@ DataOutReader<dim, spacedim>::read_whole_parallel_file(std::istream &in)
 
   ParallelIntermediateHeaderType header;
   in.read(reinterpret_cast<char *>(&header), sizeof(header));
+  AssertThrow(
+    header.magic == 0x00dea111,
+    ExcMessage(
+      "Invalid header of parallel deal.II intermediate format encountered."));
+  AssertThrow(
+    header.version == DataOutBase::Deal_II_IntermediateFlags::format_version,
+    ExcMessage(
+      "Incorrect header version of parallel deal.II intermediate format."));
 
   std::vector<std::uint64_t> chunk_sizes(header.num_ranks);
   in.read(reinterpret_cast<char *>(chunk_sizes.data()),

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.