mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
samplefmt: avoid integer overflow in av_samples_get_buffer_size()
CC:libav-stable@libav.org
(cherry picked from commit 0e830094ad)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
5b38967745
commit
0e551aa966
@@ -135,6 +135,8 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
|
||||
|
||||
/* auto-select alignment if not specified */
|
||||
if (!align) {
|
||||
if (nb_samples > INT_MAX - 31)
|
||||
return AVERROR(EINVAL);
|
||||
align = 1;
|
||||
nb_samples = FFALIGN(nb_samples, 32);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user