Skip to content

Commit

Permalink
Use the correct size with std::fill_n
Browse files Browse the repository at this point in the history
  • Loading branch information
sakertooth committed Feb 11, 2024
1 parent 267b5c1 commit 8ac3aac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/Sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ bool Sample::play(sampleFrame* dst, PlaybackState* state, size_t numFrames, floa

if (resampleResult.outputFramesGenerated < numFrames)
{
std::fill_n(dst + resampleResult.outputFramesGenerated, numFrames, sampleFrame{});
std::fill_n(dst + resampleResult.outputFramesGenerated, numFrames - resampleResult.outputFramesGenerated,
sampleFrame{});
}

if (!typeInfo<float>::isEqual(m_amplification, 1.0f))
Expand Down

0 comments on commit 8ac3aac

Please sign in to comment.