Skip to content

Commit

Permalink
ByteProvider interface already supports writing multiple DES buffers.…
Browse files Browse the repository at this point in the history
… Unfortunately, the subheader length is not correct because the ByteStream it uses to tally buffer size continues to increment.
  • Loading branch information
dstarinshak committed Oct 22, 2018
1 parent ed27b46 commit eb04970
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/c++/nitf/source/ByteProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ void ByteProvider::getFileLayout(nitf::Record& inRecord,

std::vector<size_t> desSubheaderLengths(numDESs);
std::vector<size_t> desDataLengths(numDESs);

for (size_t ii = 0; ii < numDESs; ++ii)
{
nitf::DESegment deSegment = record.getDataExtensions()[ii];
nitf::DESubheader subheader = deSegment.getSubheader();
nitf::Uint32 userSublen;
const size_t prevSize = byteStream->getSize();
writer.writeDESubheader(subheader, userSublen, record.getVersion());
desSubheaderLengths[ii] = byteStream->getSize();
desSubheaderLengths[ii] = byteStream->getSize() - prevSize;

// Write data
const PtrAndLength& curData(desData[ii]);
Expand Down

0 comments on commit eb04970

Please sign in to comment.