Commit 88f8de87 authored by Volker Krause's avatar Volker Krause
Browse files

Fix 0080BL sub-block iteration boundaries check

This ended up producing a lot of debug output spam.
parent 5d6f3915
......@@ -45,7 +45,7 @@ Vendor0080BLSubBlock::Vendor0080BLSubBlock(const Uic9183Block &block, int offset
return;
}
if (block.size() < offset + SBlockHeaderSize) {
if (block.contentSize() < offset + SBlockHeaderSize) {
qCWarning(Log) << "0080BL S-block too small";
return;
}
......@@ -55,7 +55,7 @@ Vendor0080BLSubBlock::Vendor0080BLSubBlock(const Uic9183Block &block, int offset
}
m_block = block;
if (block.size() < offset + size()) {
if (block.contentSize() < offset + size()) {
qCWarning(Log) << "0080BL S-block size exceeds 0080BL block size";
m_block = {};
}
......@@ -73,6 +73,9 @@ int Vendor0080BLSubBlock::size() const
Vendor0080BLSubBlock Vendor0080BLSubBlock::nextBlock() const
{
if (m_offset + size() >= m_block.contentSize()) { // we are the last block
return {};
}
return Vendor0080BLSubBlock(m_block, m_offset + size());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment