[FFmpeg-cvslog] samplefmt: avoid integer overflow in av_samples_get_buffer_size()

Justin Ruggles git at videolan.org
Sat Mar 8 16:21:08 CET 2014


ffmpeg | branch: release/0.11 | Justin Ruggles <justin.ruggles at gmail.com> | Thu Jan 30 14:08:38 2014 -0500| [236b7b16ebcc2d9280336e7b02972e3c7de982e2] | committer: Michael Niedermayer

samplefmt: avoid integer overflow in av_samples_get_buffer_size()

CC:libav-stable at libav.org
(cherry picked from commit 0e830094ad0dc251613a0aa3234d9c5c397e02e6)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=236b7b16ebcc2d9280336e7b02972e3c7de982e2
---

 libavutil/samplefmt.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c
index ae192ff..3c3a0e6 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);
     }



More information about the ffmpeg-cvslog mailing list