From 8755dd20d54cd42f76e15f4be57d1b8f645072df Mon Sep 17 00:00:00 2001 From: Silent Date: Fri, 6 Jul 2018 00:15:36 +0200 Subject: [PATCH] Code clarity fix for CAEFLACDecoder::write_cb --- SilentPatchSA/FLACDecoderSA.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SilentPatchSA/FLACDecoderSA.cpp b/SilentPatchSA/FLACDecoderSA.cpp index 4bd1ce0..89db547 100644 --- a/SilentPatchSA/FLACDecoderSA.cpp +++ b/SilentPatchSA/FLACDecoderSA.cpp @@ -50,10 +50,10 @@ FLAC__StreamDecoderWriteStatus CAEFLACDecoder::write_cb(const FLAC__StreamDecode pClientData->m_maxBlockSize = pClientData->m_curBlockSize; } - std::copy_n( buffer[0], pClientData->m_curBlockSize, stdext::make_checked_array_iterator(pClientData->m_buffer, pClientData->m_curBlockSize) ); + auto it = std::copy_n( buffer[0], pClientData->m_curBlockSize, stdext::make_checked_array_iterator(pClientData->m_buffer, pClientData->m_curBlockSize * processedChannels) ); if ( processedChannels > 1 ) { - std::copy_n( buffer[1], pClientData->m_curBlockSize, stdext::make_checked_array_iterator(pClientData->m_buffer+pClientData->m_curBlockSize, pClientData->m_curBlockSize) ); + std::copy_n( buffer[1], pClientData->m_curBlockSize, it ); } return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;