summaryrefslogtreecommitdiff
path: root/libavutil/samplefmt.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-05 01:30:18 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-05 01:30:24 +0100
commitd80b9ea11da1680a3373a52a6031e2717cade25b (patch)
tree94b5c3186a2d5af2333f82acddfb08e45c60aa25 /libavutil/samplefmt.c
parentbd9492174d978f9d8b82d945cda9b5a52f0fa437 (diff)
parent0e830094ad0dc251613a0aa3234d9c5c397e02e6 (diff)
downloadffmpeg-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.c2
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);
}