[vlmc-devel] AudioSample: Always initialize buff & size

Hugo Beauzée-Luyssen git at videolan.org
Mon Mar 28 18:03:47 CEST 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 28 17:23:52 2016 +0200| [bf0459d564766b2234ac91d8f33ca36d1c5cd021] | committer: Hugo Beauzée-Luyssen

AudioSample: Always initialize buff & size

> https://code.videolan.org/videolan/vlmc/commit/bf0459d564766b2234ac91d8f33ca36d1c5cd021
---

 src/Workflow/AudioClipWorkflow.cpp | 1 -
 src/Workflow/Types.h               | 7 ++++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/Workflow/AudioClipWorkflow.cpp b/src/Workflow/AudioClipWorkflow.cpp
index 1fbab59..bdc82f1 100644
--- a/src/Workflow/AudioClipWorkflow.cpp
+++ b/src/Workflow/AudioClipWorkflow.cpp
@@ -42,7 +42,6 @@ AudioClipWorkflow::preallocate()
     for ( quint32 i = 0; i < AudioClipWorkflow::nbBuffers; ++i )
     {
         Workflow::AudioSample *as = new Workflow::AudioSample;
-        as->buff = nullptr;
         m_availableBuffers.push_back( as );
     }
 }
diff --git a/src/Workflow/Types.h b/src/Workflow/Types.h
index 0bd76a6..165e2f5 100644
--- a/src/Workflow/Types.h
+++ b/src/Workflow/Types.h
@@ -109,7 +109,12 @@ namespace   Workflow
     class  AudioSample : public OutputBuffer
     {
         public:
-            AudioSample() : OutputBuffer( AudioTrack ){}
+            AudioSample()
+                : OutputBuffer( AudioTrack )
+                , buff( nullptr )
+                , size( 0 )
+            {
+            }
             unsigned char*  buff;
             size_t          size;
             quint32         nbSample;



More information about the Vlmc-devel mailing list