diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-05 01:30:18 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-05 01:30:24 +0100 |
commit | d80b9ea11da1680a3373a52a6031e2717cade25b (patch) | |
tree | 94b5c3186a2d5af2333f82acddfb08e45c60aa25 /libavutil/samplefmt.c | |
parent | bd9492174d978f9d8b82d945cda9b5a52f0fa437 (diff) | |
parent | 0e830094ad0dc251613a0aa3234d9c5c397e02e6 (diff) | |
download | ffmpeg-d80b9ea11da1680a3373a52a6031e2717cade25b.tar.gz |
Merge commit '0e830094ad0dc251613a0aa3234d9c5c397e02e6'
* commit '0e830094ad0dc251613a0aa3234d9c5c397e02e6':
samplefmt: avoid integer overflow in av_samples_get_buffer_size()
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/samplefmt.c')
-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 08ecc83467..a1986980f0 100644 --- a/libavutil/samplefmt.c +++ b/libavutil/samplefmt.c @@ -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); } |