- fix few audio processing bugs

This commit is contained in:
2026-07-06 12:33:16 +03:00
parent 0e48bed9c1
commit 3d455732ea
3 changed files with 18 additions and 4 deletions
+6 -3
View File
@@ -66,10 +66,13 @@ size_t SpeexResampler::processBuffer(const void* src, size_t sourceLength, size_
if (mDestRate == mSourceRate)
{
// Pass-through, but never write past the caller's buffer: clamp to its
// capacity instead of trusting sourceLength (which is caller/file driven).
assert(destCapacity >= sourceLength);
memcpy(dest, src, sourceLength);
sourceProcessed = sourceLength;
return sourceLength;
size_t copied = std::min(sourceLength, destCapacity);
memcpy(dest, src, copied);
sourceProcessed = copied;
return copied;
}
if (!mContext)