aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-07-05 19:20:53 -0400
committerJack Lloyd <[email protected]>2019-07-05 19:20:53 -0400
commitbab50f163ef4449725dc15b5acbcab2ad177b18c (patch)
tree72b3e42c7d368cad6262e057aa9a572ada0405ea
parente15d1c2b72102a2e01aff0e344f023753407ccfb (diff)
Avoid pointless write
The last 4 bytes are always overwritten in this loop.
-rw-r--r--src/lib/stream/ctr/ctr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/stream/ctr/ctr.cpp b/src/lib/stream/ctr/ctr.cpp
index 219d8042c..f1d8d97b8 100644
--- a/src/lib/stream/ctr/ctr.cpp
+++ b/src/lib/stream/ctr/ctr.cpp
@@ -216,7 +216,7 @@ void CTR_BE::seek(uint64_t offset)
const uint32_t low32 = load_be<uint32_t>(&m_counter[BS-4], 0);
for(size_t i = 1; i != m_ctr_blocks; ++i)
{
- copy_mem(&m_counter[i*BS], &m_counter[0], BS);
+ copy_mem(&m_counter[i*BS], &m_counter[0], BS - 4);
const uint32_t c = static_cast<uint32_t>(low32 + i);
store_be(c, &m_counter[(BS-4)+i*BS]);
}