Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
audio/stream: fix memory corruption with certain files
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Jul 11, 2024
1 parent 31165c6 commit 23fa947
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/engine/audio_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ static bool Audio_Stream_EnqueueFrame(AUDIO_STREAM_SOUND *stream)
NULL, stream->swr.dst_channels, resampled_size,
stream->swr.dst_format, 1);

if (out_buffer_size > m_DecodeBufferCapacity) {
m_DecodeBufferCapacity += out_buffer_size;
if (out_pos + out_buffer_size > m_DecodeBufferCapacity) {
m_DecodeBufferCapacity = out_pos + out_buffer_size;
m_DecodeBuffer =
Memory_Realloc(m_DecodeBuffer, m_DecodeBufferCapacity);
}
Expand Down

0 comments on commit 23fa947

Please sign in to comment.