mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-03 13:24:05 +00:00
samplefmt: avoid integer overflow in av_samples_get_buffer_size()
CC:libav-stable@libav.org
This commit is contained in:
parent
190d4a447b
commit
0e830094ad
@ -118,6 +118,8 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
|
|||||||
|
|
||||||
/* auto-select alignment if not specified */
|
/* auto-select alignment if not specified */
|
||||||
if (!align) {
|
if (!align) {
|
||||||
|
if (nb_samples > INT_MAX - 31)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
align = 1;
|
align = 1;
|
||||||
nb_samples = FFALIGN(nb_samples, 32);
|
nb_samples = FFALIGN(nb_samples, 32);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user