From a3f491d43692e999270db5bac17717e8dfa60612 Mon Sep 17 00:00:00 2001
From: "Matthias P. Braendli" <matthias.braendli@mpb.li>
Date: Fri, 21 Nov 2014 07:52:14 +0100
Subject: fix segfault, dump dabp

---
 etisnoop/faad_decoder.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'etisnoop/faad_decoder.cpp')

diff --git a/etisnoop/faad_decoder.cpp b/etisnoop/faad_decoder.cpp
index 21b12fa..17024ca 100644
--- a/etisnoop/faad_decoder.cpp
+++ b/etisnoop/faad_decoder.cpp
@@ -37,9 +37,10 @@ using namespace std;
 
 FaadDecoder::FaadDecoder() :
     m_data_len(0),
+    m_fd(NULL),
+    m_aac(NULL),
     m_initialised(false)
 {
-    m_aac = NULL;
 }
 
 void FaadDecoder::open(string filename, bool ps_flag, bool aac_channel_mode,
@@ -137,7 +138,7 @@ bool FaadDecoder::decode(vector<vector<uint8_t> > aus)
 
         memcpy(helpBuffer, d_header, 7 * sizeof(uint8_t));
         memcpy(&helpBuffer[7],
-                &au[0], vh.aac_frame_length * sizeof (uint8_t));
+                &au[0], au.size() * sizeof (uint8_t));
 
         fwrite(helpBuffer, 1, vh.aac_frame_length, m_aac);
 
@@ -178,11 +179,13 @@ bool FaadDecoder::decode(vector<vector<uint8_t> > aus)
         m_channels    = hInfo.channels;
         size_t samples  = hInfo.samples;
 
+#if 0
         printf("bytes consumed %d\n", (int)(hInfo.bytesconsumed));
         printf("samplerate = %d, samples = %zu, channels = %d,"
                 " error = %d, sbr = %d\n", m_sample_rate, samples,
                 m_channels, hInfo.error, hInfo.sbr);
         printf("header = %d\n", hInfo.header_type);
+#endif
 
         if (hInfo.error != 0) {
             printf("FAAD Warning: %s\n",
-- 
cgit v1.2.3