[FFmpeg-cvslog] lavfi/ashowinfo: check plane value before deferencing.

Clément Bœsch git at videolan.org
Sun Sep 30 20:55:15 CEST 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sun Sep 30 20:58:01 2012 +0200| [13d878366f4ef15e64d2fc29d482ab283ac75282] | committer: Clément Bœsch

lavfi/ashowinfo: check plane value before deferencing.

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

 libavfilter/af_ashowinfo.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_ashowinfo.c b/libavfilter/af_ashowinfo.c
index 0d4bbb2..25a5e2c 100644
--- a/libavfilter/af_ashowinfo.c
+++ b/libavfilter/af_ashowinfo.c
@@ -53,7 +53,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
     if (!av_sample_fmt_is_planar(samplesref->format))
         linesize *= av_get_channel_layout_nb_channels(samplesref->audio->channel_layout);
 
-    for (plane = 0; samplesref->data[plane] && plane < 8; plane++) {
+    for (plane = 0; plane < 8 && samplesref->data[plane]; plane++) {
         uint8_t *data = samplesref->data[plane];
 
         plane_checksum[plane] = av_adler32_update(plane_checksum[plane],
@@ -78,7 +78,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
            checksum,
            plane_checksum[0]);
 
-    for (plane = 1; samplesref->data[plane] && plane < 8; plane++)
+    for (plane = 1; plane < 8 && samplesref->data[plane]; plane++)
         av_log(ctx, AV_LOG_INFO, " %08X", plane_checksum[plane]);
     av_log(ctx, AV_LOG_INFO, "]\n");
 



More information about the ffmpeg-cvslog mailing list