aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/samplefmt.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-03-27 21:31:14 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-04-09 10:20:35 -0400
commit0109a09dc3850eb5dbff84a7bb50eb252a5a8f22 (patch)
treeb2e54182bb966158328bdefacab5772647b388d2 /libavutil/samplefmt.c
parent18ed3788b0ebdfde916eac969d7f9ecd5e884f39 (diff)
downloadffmpeg-0109a09dc3850eb5dbff84a7bb50eb252a5a8f22.tar.gz
avutil: use align == 0 for default alignment in audio sample buffer functions
Diffstat (limited to 'libavutil/samplefmt.c')
-rw-r--r--libavutil/samplefmt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c
index 761009f2e2..2e0aa98f58 100644
--- a/libavutil/samplefmt.c
+++ b/libavutil/samplefmt.c
@@ -123,6 +123,10 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
return AVERROR(EINVAL);
+ /* auto-select alignment if not specified */
+ if (!align)
+ align = 32;
+
/* check for integer overflow */
if (nb_channels > INT_MAX / align ||
(int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)