Mercurial > hg > svcore
comparison data/fileio/MP3FileReader.cpp @ 977:048173126e71
Fix some uninitialised values (from coverity scan)
author | Chris Cannam |
---|---|
date | Wed, 03 Sep 2014 13:06:13 +0100 |
parents | d03b3d956358 |
children | cc27f35aa75c |
comparison
equal
deleted
inserted
replaced
976:45e95de8b11d | 977:048173126e71 |
---|---|
61 return; | 61 return; |
62 } | 62 } |
63 | 63 |
64 m_fileSize = stat.st_size; | 64 m_fileSize = stat.st_size; |
65 | 65 |
66 m_filebuffer = 0; | |
67 m_samplebuffer = 0; | |
68 m_samplebuffersize = 0; | |
69 | |
66 int fd = -1; | 70 int fd = -1; |
67 if ((fd = ::open(m_path.toLocal8Bit().data(), O_RDONLY | 71 if ((fd = ::open(m_path.toLocal8Bit().data(), O_RDONLY |
68 #ifdef _WIN32 | 72 #ifdef _WIN32 |
69 | O_BINARY | 73 | O_BINARY |
70 #endif | 74 #endif |
71 , 0)) < 0) { | 75 , 0)) < 0) { |
72 m_error = QString("Failed to open file %1 for reading.").arg(m_path); | 76 m_error = QString("Failed to open file %1 for reading.").arg(m_path); |
73 return; | 77 return; |
74 } | 78 } |
75 | |
76 m_filebuffer = 0; | |
77 m_samplebuffer = 0; | |
78 m_samplebuffersize = 0; | |
79 | 79 |
80 try { | 80 try { |
81 m_filebuffer = new unsigned char[m_fileSize]; | 81 m_filebuffer = new unsigned char[m_fileSize]; |
82 } catch (...) { | 82 } catch (...) { |
83 m_error = QString("Out of memory"); | 83 m_error = QString("Out of memory"); |