Skip to content

Commit

Permalink
Fix OOB access of ref ratio on HDF write header (AMReX-Codes#2919)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf committed Aug 18, 2022
1 parent fa8e20f commit f270b3d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Src/Extern/HDF5/AMReX_PlotFileUtilHDF5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,8 @@ WriteGenericPlotfileHeaderHDF5 (hid_t fid,

int ratio = 1;
if (ref_ratio.size() > 0)
ratio = ref_ratio[level][0];
ratio = (level == finest_level)? 1: ref_ratio[level][0];

if (level == finest_level) {
ratio = 1;
}
CreateWriteHDF5AttrInt(grp, "ref_ratio", 1, &ratio);

for (int k = 0; k < AMREX_SPACEDIM; ++k) {
Expand Down

0 comments on commit f270b3d

Please sign in to comment.