aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2014-01-30 14:08:38 -0500
committerMichael Niedermayer <michaelni@gmx.at>2014-03-05 03:06:10 +0100
commitbb683ebdba9bfe7521b213c5314ff6ea1fc00990 (patch)
tree78301ce790c0b49ef2ca7b78329dbc1737a135dc
parentb3cc4bd18f3c43ad2d84448a9f3c20f0c908b15e (diff)
downloadffmpeg-bb683ebdba9bfe7521b213c5314ff6ea1fc00990.tar.gz
samplefmt: avoid integer overflow in av_samples_get_buffer_size()
CC:libav-stable@libav.org (cherry picked from commit 0e830094ad0dc251613a0aa3234d9c5c397e02e6) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/samplefmt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c
index 6f762df9b4..d25cc98fe7 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);
}