[vlc-devel] commit: Fixed potential use of uninitialized value (format.c). ( Laurent Aimar )

git version control git at videolan.org
Sat Feb 6 14:41:02 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Feb  6 14:35:25 2010 +0100| [420e58dec7eca53e9bf630ebfe92b518f0c045be] | committer: Laurent Aimar 

Fixed potential use of uninitialized value (format.c).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=420e58dec7eca53e9bf630ebfe92b518f0c045be
---

 modules/audio_filter/converter/format.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/modules/audio_filter/converter/format.c b/modules/audio_filter/converter/format.c
index 87040a2..22fae91 100644
--- a/modules/audio_filter/converter/format.c
+++ b/modules/audio_filter/converter/format.c
@@ -170,14 +170,12 @@ static block_t *Filter(filter_t *filter, block_t *block)
         sys->pre(block);
 
     for (int i = 0; i < 2; i++) {
-        block_t *out;
         if (sys->directs[i]) {
-            out = sys->directs[i](filter, block);
-            assert(out == block);
+            block = sys->directs[i](filter, block);
         } else if (sys->indirects[i]) {
             int dst_size = sys->indirects_ratio[i][1] *
                            (block->i_buffer / sys->indirects_ratio[i][0]);
-            out = filter_NewAudioBuffer(filter, dst_size);
+            block_t *out = filter_NewAudioBuffer(filter, dst_size);
             if (!out) {
                 block_Release(block);
                 return NULL;
@@ -191,8 +189,8 @@ static block_t *Filter(filter_t *filter, block_t *block)
             sys->indirects[i](out, block);
 
             block_Release(block);
+            block = out;
         }
-        block = out;
     }
 
     if (sys->post)




More information about the vlc-devel mailing list