1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 00:42:57 +00:00
mpv/audio/filter
Peter DeLong f46bbde5e6 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.
2022-09-23 18:15:00 +02:00
..
af_drop.c audio: redo video-sync=display-adrop 2020-05-23 04:04:46 +02:00
af_format.c options: cleanup .min use for OPT_CHANNELS 2020-04-09 11:27:38 +02:00
af_lavcac3enc.c af_lavcac3enc: switch to AVChannelLayout when available 2022-06-14 22:41:20 +03:00
af_rubberband.c af_rubberband: add new engine option in rubberband 3.0.0 2022-08-03 15:29:02 +00:00
af_scaletempo2_internals.c af_scaletempo2: fix crash when the number of channels increases 2022-09-23 18:15:00 +02:00
af_scaletempo2_internals.h various: remove trailing whitespace 2022-05-14 14:51:34 +00:00
af_scaletempo2.c various: remove trailing whitespace 2022-05-14 14:51:34 +00:00
af_scaletempo.c af_scaletempo: handle obscure integer overflow 2020-06-02 20:43:49 +02:00