[FFmpeg-cvslog] af_join: initialize a variable to shut up gcc warning.

Anton Khirnov git at videolan.org
Wed Jun 27 02:07:41 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Jun 25 12:57:16 2012 +0200| [fd2784c3b5e5ea13dd308b1eeeef0dd3c22a3d4a] | committer: Anton Khirnov

af_join: initialize a variable to shut up gcc warning.

The warning silenced was:
libavfilter/af_join.c: In function ‘join_request_frame’:
libavfilter/af_join.c:451:9: warning: ‘nb_samples’ may be used uninitialized in this function [-Wuninitialized]

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

 libavfilter/af_join.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c
index 89bc47f..e86c556 100644
--- a/libavfilter/af_join.c
+++ b/libavfilter/af_join.c
@@ -419,7 +419,7 @@ static int join_request_frame(AVFilterLink *outlink)
     JoinBufferPriv *priv;
     int linesize   = INT_MAX;
     int perms      = ~0;
-    int nb_samples;
+    int nb_samples = 0;
     int i, j, ret;
 
     /* get a frame on each input */
@@ -448,6 +448,7 @@ static int join_request_frame(AVFilterLink *outlink)
         perms     &= cur_buf->perms;
     }
 
+    av_assert0(nb_samples > 0);
     buf = avfilter_get_audio_buffer_ref_from_arrays(s->data, linesize, perms,
                                                     nb_samples, outlink->format,
                                                     outlink->channel_layout);



More information about the ffmpeg-cvslog mailing list