bugfix: mp3Buf was deleted too early

This commit is contained in:
darkeye 2002-07-28 00:08:37 +00:00
parent 529d4e66b0
commit ba1028e62c
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,9 @@
DarkIce 0.11
o bug fix for LameLibEncoder: the mp3 encoding buffer was deleted too
early, resulting in mp3 data corruption.
thanks to Nicu Pavel <npavel@ituner.com>
20-07-2002: DarkIce 0.10 released 20-07-2002: DarkIce 0.10 released
o added possibility to select constant, average and variable bit rate o added possibility to select constant, average and variable bit rate

View File

@ -312,7 +312,6 @@ LameLibEncoder :: write ( const void * buf,
mp3Buf, mp3Buf,
mp3Size ); mp3Size );
delete[] mp3Buf;
delete[] leftBuffer; delete[] leftBuffer;
delete[] rightBuffer; delete[] rightBuffer;
@ -322,6 +321,7 @@ LameLibEncoder :: write ( const void * buf,
} }
unsigned int written = sink->write( mp3Buf, ret); unsigned int written = sink->write( mp3Buf, ret);
delete[] mp3Buf;
// just let go data that could not be written // just let go data that could not be written
if ( written < (unsigned int) ret ) { if ( written < (unsigned int) ret ) {
reportEvent( 2, reportEvent( 2,
@ -387,6 +387,9 @@ LameLibEncoder :: close ( void ) throw ( Exception )
$Source$ $Source$
$Log$ $Log$
Revision 1.13 2002/07/28 00:08:37 darkeye
bugfix: mp3Buf was deleted too early
Revision 1.12 2002/05/28 12:35:41 darkeye Revision 1.12 2002/05/28 12:35:41 darkeye
code cleanup: compiles under gcc-c++ 3.1, using -pedantic option code cleanup: compiles under gcc-c++ 3.1, using -pedantic option