[FFmpeg-devel] [0.11] [PATCH 1/2] lavfi/audio: fix an invalid boundary check.

Nicolas George nicolas.george at normalesup.org
Wed Sep 12 19:45:45 CEST 2012


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Only for 0.11 branch, the code has been replaced since.


diff --git a/libavfilter/audio.c b/libavfilter/audio.c
index 0616f97..2e62506 100644
--- a/libavfilter/audio.c
+++ b/libavfilter/audio.c
@@ -204,7 +204,7 @@ void ff_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 < 8; i++)
+        for (i = 0; i < 8 && samplesref->data[i]; i++)
             memcpy(link->cur_buf->data[i], samplesref->data[i], samplesref->linesize[0]);
         for (i = 0; i < planes; i++)
             memcpy(link->cur_buf->extended_data[i], samplesref->extended_data[i], samplesref->linesize[0]);
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list