Skip to content

Commit

Permalink
MRF: Fix padding space logic (OSGeo#5096)
Browse files Browse the repository at this point in the history
It got broken a while ago, it is not used often
  • Loading branch information
lucianpls authored Jan 12, 2022
1 parent de6c7a4 commit 4afab38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frmts/mrf/marfa_dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2110,8 +2110,8 @@ CPLErr MRFDataset::WriteTile(void* buff, GUIntBig infooffset, GUIntBig size)

// Spacing should be 0 in MP safe mode, this doesn't have much of effect
// Use the existing data, spacing content is not guaranteed
for (GUIntBig pending = spacing; pending != 0; pending -= std::max(pending, size))
VSIFWriteL(buff, 1, static_cast<size_t>(std::max(pending, size)), l_dfp); // Usually only once
for (GUIntBig pending = spacing; pending != 0; pending -= std::min(pending, size))
VSIFWriteL(buff, 1, static_cast<size_t>(std::min(pending, size)), l_dfp); // Usually only once

if (static_cast<size_t>(size) != VSIFWriteL(buff, 1, static_cast<size_t>(size), l_dfp))
ret = CE_Failure;
Expand Down

0 comments on commit 4afab38

Please sign in to comment.