Skip to content

Commit

Permalink
Fix crash when querying the CDDB database after performing a conversi…
Browse files Browse the repository at this point in the history
…on/rip.
  • Loading branch information
enzo1982 committed Jul 26, 2021
1 parent 8e91931 commit d6323bb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions Readme
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ History

- Bug fixes

- fixed possible crash upon querying the CDDB database
- fixed issue ripping CD tracks when output filename pattern is <filename>

- Updated codecs
Expand Down
1 change: 1 addition & 0 deletions Readme.de
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ Geschichte

- Behobene Fehler

- Möglichen Absturz beim Abfragen der CDDB-Datenbank behoben
- Problem beim Rippen von CD-Tracks mit <filename> als Ausgabedateinamensvorlage behoben

- Aktualisierte Codecs
Expand Down
16 changes: 8 additions & 8 deletions components/extension/protocols/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ using namespace smooth::IO;
Array<BoCA::ProtocolData> BoCA::ProtocolWriter::protocolData;
Int BoCA::ProtocolWriter::instanceCount = 0;

BoCA::ProtocolData::ProtocolData()
BoCA::ProtocolData::ProtocolData(Int conversion, const Array<Track> *tracks)
{
conversionID = -1;
preliminary = (conversion >= 0);
conversionID = conversion;

fileStream = NIL;
copyStream = NIL;

trackList = NIL;
trackList = tracks;
}

BoCA::ProtocolData::~ProtocolData()
Expand Down Expand Up @@ -82,10 +83,12 @@ Void BoCA::ProtocolWriter::OnUpdateProtocolList()

/* Add or update protocol data.
*/
if (protocolData.Length() > 0 && protocolData.GetLast().conversionID >= 0)
if (protocolData.Length() > 0 && protocolData.GetLast().preliminary)
{
ProtocolData data = protocolData.GetLast();

data.preliminary = False;

protocolData.RemoveNth(protocolData.Length() - 1);
protocolData.Add(data, index);
}
Expand Down Expand Up @@ -152,10 +155,7 @@ Void BoCA::ProtocolWriter::OnUpdateProtocol(const String &name)

Void BoCA::ProtocolWriter::OnStartConversion(Int conversionID, const Array<Track> &tracks)
{
ProtocolData data;

data.conversionID = conversionID;
data.trackList = &tracks;
ProtocolData data(conversionID, &tracks);

protocolData.Add(data);
}
Expand Down
3 changes: 2 additions & 1 deletion components/extension/protocols/writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ namespace BoCA
class ProtocolData
{
public:
ProtocolData();
ProtocolData(Int = -1, const Array<Track> * = NIL);
~ProtocolData();

Bool preliminary;
Int conversionID;

String fileHeader;
Expand Down

0 comments on commit d6323bb

Please sign in to comment.