diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2014-01-30 14:08:38 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2014-02-04 12:32:47 -0500 |
commit | 0e830094ad0dc251613a0aa3234d9c5c397e02e6 (patch) | |
tree | 1016d79a5c9a101a952b7ea501a50ae341f0abd4 /libavutil | |
parent | 190d4a447bc6ae4ecbbbb1c70f482a9c1fb6026c (diff) | |
download | ffmpeg-0e830094ad0dc251613a0aa3234d9c5c397e02e6.tar.gz |
samplefmt: avoid integer overflow in av_samples_get_buffer_size()
CC:libav-stable@libav.org
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/samplefmt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c index 389f726d65..bff600447c 100644 --- a/libavutil/samplefmt.c +++ b/libavutil/samplefmt.c @@ -118,6 +118,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); } |