Fix a bug in the gainer where a null pointer can be offset.

This commit is contained in:
David Reid
2026-01-07 12:13:18 +10:00
parent 32cc6d53cd
commit bedfd053cb
+5 -5
View File
@@ -50869,15 +50869,15 @@ static /*__attribute__((noinline))*/ ma_result ma_gainer_process_pcm_frames_inte
a += d; a += d;
} }
} }
pFramesOut = ma_offset_ptr(pFramesOut, interpolatedFrameCount * sizeof(float));
pFramesIn = ma_offset_ptr(pFramesIn, interpolatedFrameCount * sizeof(float));
} }
frameCount -= interpolatedFrameCount;
/* Make sure the timer is updated. */ /* Make sure the timer is updated. */
pGainer->t = (ma_uint32)ma_min(pGainer->t + interpolatedFrameCount, pGainer->config.smoothTimeInFrames); pGainer->t = (ma_uint32)ma_min(pGainer->t + interpolatedFrameCount, pGainer->config.smoothTimeInFrames);
/* Adjust our arguments so the next part can work normally. */
frameCount -= interpolatedFrameCount;
pFramesOut = ma_offset_ptr(pFramesOut, interpolatedFrameCount * sizeof(float));
pFramesIn = ma_offset_ptr(pFramesIn, interpolatedFrameCount * sizeof(float));
} }
/* All we need to do here is apply the new gains using an optimized path. */ /* All we need to do here is apply the new gains using an optimized path. */