diff options
author | Peter DeLong <petersdelong@gmail.com> | 2022-08-21 18:00:58 -0400 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-09-23 18:15:00 +0200 |
commit | f46bbde5e62243e284da2ff051e7f245ce2901a8 (patch) | |
tree | a57047d4dfd2bacac82723aa8e7c5952528dcff9 /audio/out/ao_openal.c | |
parent | e6c5d58d1ed95c503ec7261a3d85de32315192cf (diff) | |
download | mpv-f46bbde5e62243e284da2ff051e7f245ce2901a8.tar.bz2 mpv-f46bbde5e62243e284da2ff051e7f245ce2901a8.tar.xz |
af_scaletempo2: fix crash when the number of channels increases
When af_scaletempo2.c:process() detects a format change, it goes back
through mp_scaletempo2_init() to reinitialize everything. However,
mp_scaletempo2.input_buffer is not necessarily reallocated due to a
check in af_scaletempo2_internals.c:resize_input_buffer(). This is a
problem if the number of audio channels increases, since without
reallocating, the buffer for the new channel(s) will at best point to
NULL, and at worst uninitialized memory.
Since resize_input_buffer() is only called from two places, pull size
check out into mp_scaletempo2_fill_input_buffer(). This allows each
caller to decide whether they want to resize or not. We could be
smarter about when to reallocate, but that would add a lot of machinery
for a case I don't expect to be hit often in practice.
Diffstat (limited to 'audio/out/ao_openal.c')
0 files changed, 0 insertions, 0 deletions