From eea61b2604fa5af8b409e49454084beead04409d Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 10 Apr 2025 11:59:22 +0200 Subject: [PATCH] audio_frame2::change_ch_count: fix CID 480257 the behavior is now very slightly modified but effectively the same, eg. change 1 to 3 channels copies now channel 0 to 1 and then 1 to 2 (before it copies 0 to both 1 and 2). --- src/audio/types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/types.cpp b/src/audio/types.cpp index cb15e1f72..f1f74c053 100644 --- a/src/audio/types.cpp +++ b/src/audio/types.cpp @@ -347,8 +347,8 @@ void audio_frame2::change_ch_count(int ch_count) return; } - const channel &last_ch = channels.at(channels.size() - 1); for (unsigned i = channels.size(); i < (unsigned) ch_count; ++i) { + const channel &last_ch = channels.at(channels.size() - 1); std::unique_ptr data = std::unique_ptr(new char[last_ch.len]); memcpy(data.get(), last_ch.data.get(), last_ch.len);