mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avutil: change default buffer size alignment for sample buffer functions
Aligning nb_samples will give both correct plane pointer alignment and enough padding for SIMD-optimized functions.
This commit is contained in:
parent
0ca4414d0f
commit
83b26046fc
@ -124,8 +124,10 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
|
|||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
/* auto-select alignment if not specified */
|
/* auto-select alignment if not specified */
|
||||||
if (!align)
|
if (!align) {
|
||||||
align = 32;
|
align = 1;
|
||||||
|
nb_samples = FFALIGN(nb_samples, 32);
|
||||||
|
}
|
||||||
|
|
||||||
/* check for integer overflow */
|
/* check for integer overflow */
|
||||||
if (nb_channels > INT_MAX / align ||
|
if (nb_channels > INT_MAX / align ||
|
||||||
|
Loading…
Reference in New Issue
Block a user