[FFmpeg-cvslog] lavfi: add missing check in avfilter_filter_samples()
Stefano Sabatini
git at videolan.org
Thu Jan 12 22:03:05 CET 2012
ffmpeg | branch: release/0.8 | Stefano Sabatini <stefasab at gmail.com> | Tue Dec 27 15:15:02 2011 +0100| [c4cc8584d0e48a9474a52eed725ed726d14d3f2f] | committer: Michael Niedermayer
lavfi: add missing check in avfilter_filter_samples()
Avoid out-of-buffer data access when nb_channels is 8.
(cherry picked from commit ae21776207e8a2bbe268e7c9e203f7599dd87ddb)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4cc8584d0e48a9474a52eed725ed726d14d3f2f
---
libavfilter/avfilter.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index a57677c..d2b4986 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -614,7 +614,7 @@ void avfilter_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
link->cur_buf->audio->sample_rate = samplesref->audio->sample_rate;
/* Copy actual data into new samples buffer */
- for (i = 0; samplesref->data[i]; i++)
+ for (i = 0; samplesref->data[i] && i < 8; i++)
memcpy(link->cur_buf->data[i], samplesref->data[i], samplesref->linesize[0]);
avfilter_unref_buffer(samplesref);
More information about the ffmpeg-cvslog
mailing list