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-08 15:32:44 +0100
commit236b7b16ebcc2d9280336e7b02972e3c7de982e2 (patch)
tree367302acc2fda134aa2158674d4a63e56c09b8ce
parentb66a0dce117a89db304b82dc2498c9a70c7dcecd (diff)
downloadffmpeg-236b7b16ebcc2d9280336e7b02972e3c7de982e2.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 ae192ff3d4..3c3a0e6fb1 100644
--- a/libavutil/samplefmt.c
+++ b/libavutil/samplefmt.c
@@ -134,6 +134,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);
}