summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt
diff options
context:
space:
mode:
authorThomas Jarosch <tomj@simonv.com>2012-02-29 20:09:51 +0100
committerThomas Jarosch <tomj@simonv.com>2012-02-29 20:13:17 +0100
commite8c7d10e4662c3c1d26a7500914f1ce7fdce99d4 (patch)
tree683129fd6a449a950b6aa278f208be32bdd4ecae /rbutil/rbutilqt
parent29c72591fd5c761d7a92c11d682f28599cc1ed9e (diff)
downloadrockbox-e8c7d10e4662c3c1d26a7500914f1ce7fdce99d4.tar.gz
rockbox-e8c7d10e4662c3c1d26a7500914f1ce7fdce99d4.zip
Fix mismatching C++ new[] / delete calls
cppcheck report: [rbutil/rbutilqt/base/encoderlame.cpp:273]: (error) Mismatching allocation and deallocation: mp3buf [rbutil/rbutilqt/base/encoderlame.cpp:282]: (error) Mismatching allocation and deallocation: mp3buf [rbutil/rbutilqt/base/encoderlame.cpp:289]: (error) Mismatching allocation and deallocation: mp3buf [rbutil/rbutilqt/base/encoderlame.cpp:274]: (error) Mismatching allocation and deallocation: wavbuf [rbutil/rbutilqt/base/encoderlame.cpp:283]: (error) Mismatching allocation and deallocation: wavbuf [rbutil/rbutilqt/base/encoderlame.cpp:290]: (error) Mismatching allocation and deallocation: wavbuf [rbutil/rbutilqt/base/encoderlame.cpp:184]: (error) Mismatching allocation and deallocation: buf Change-Id: I9fd54b6e02817eb900ec6e24d967da6d4beaeb27
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r--rbutil/rbutilqt/base/encoderlame.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/rbutil/rbutilqt/base/encoderlame.cpp b/rbutil/rbutilqt/base/encoderlame.cpp
index 8950d416c9..9550eb5681 100644
--- a/rbutil/rbutilqt/base/encoderlame.cpp
+++ b/rbutil/rbutilqt/base/encoderlame.cpp
@@ -181,7 +181,7 @@ bool EncoderLame::encode(QString input,QString output)
channels = buf[2] | buf[3]<<8;
samplerate = buf[4] | buf[5]<<8 | buf[6]<<16 | buf[7]<<24;
samplesize = buf[14] | buf[15]<<8;
- delete buf;
+ delete[] buf;
}
}
// read data
@@ -252,8 +252,8 @@ bool EncoderLame::encode(QString input,QString output)
else {
qDebug() << "[EncoderLame] Unknown samplesize:" << samplesize;
fin.close();
- delete mp3buf;
- delete wavbuf;
+ delete[] mp3buf;
+ delete[] wavbuf;
return false;
}
#else
@@ -270,8 +270,8 @@ bool EncoderLame::encode(QString input,QString output)
if(fout.write((char*)mp3buf, ret) != (unsigned int)ret) {
qDebug() << "[EncoderLame] Writing mp3 data failed!" << ret;
fout.close();
- delete mp3buf;
- delete wavbuf;
+ delete[] mp3buf;
+ delete[] wavbuf;
return false;
}
// flush remaining data
@@ -279,15 +279,15 @@ bool EncoderLame::encode(QString input,QString output)
if(fout.write((char*)mp3buf, ret) != (unsigned int)ret) {
qDebug() << "[EncoderLame] Writing final mp3 data failed!";
fout.close();
- delete mp3buf;
- delete wavbuf;
+ delete[] mp3buf;
+ delete[] wavbuf;
return false;
}
// shut down encoder and clean up.
m_lame_close(gfp);
fout.close();
- delete mp3buf;
- delete wavbuf;
+ delete[] mp3buf;
+ delete[] wavbuf;
return true;
}