Skip to content

Commit

Permalink
- Fixed a typo in class WAV causing the IOOpReport buffer to not be
Browse files Browse the repository at this point in the history
passed by refference for 'fileIsValidWAV', which led to undefined
behavior when the function was called. In turn this prevented converting
WAV to SMF

- Incremented version number for next release
  • Loading branch information
oblivioncth committed Oct 1, 2019
1 parent 62e3d77 commit 0a72e53
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CoH_BSC_Editor.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
#-------------------------------------------------

QT += core gui
QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

Expand Down
8 changes: 4 additions & 4 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef VERSION_H
#define VERSION_H

#define VER_FILEVERSION 0,1,2,0
#define VER_FILEVERSION_STR "0.1.2.0"
#define VER_FILEVERSION 0,1,3,0
#define VER_FILEVERSION_STR "0.1.3.0"

#define VER_PRODUCTVERSION 0,1,2,0
#define VER_PRODUCTVERSION_STR "0.1.2.0"
#define VER_PRODUCTVERSION 0,1,3,0
#define VER_PRODUCTVERSION_STR "0.1.3.0"

#define VER_COMPANYNAME_STR "Obby Apps"
#define VER_FILEDESCRIPTION_STR "BSCWorks (CoH:v14)"
Expand Down
8 changes: 3 additions & 5 deletions src/wav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@ WAV::WAV(QByteArray rawData)

//-Class Functions------------------------------------------------------------------------------------------------
//Public:
bool WAV::fileIsValidWAV(QFile &possibleWAV, Qx::IO::IOOpReport reportBuffer)
bool WAV::fileIsValidWAV(QFile &possibleWAV, Qx::IO::IOOpReport& reportBuffer)
{
// Get header region
QByteArray headers;
reportBuffer = Qx::IO::readBytesFromFile(headers, possibleWAV, 0x00, 0x1B);
reportBuffer = Qx::IO::readBytesFromFile(headers, possibleWAV, 0x00, 0x0F);

if(!reportBuffer.wasSuccessful())
return false;
else
{
// Get header region
QByteArray headers;
reportBuffer = Qx::IO::readBytesFromFile(headers, possibleWAV, 0x00, 0x0F);
long long fullFileSize = QFileInfo(possibleWAV).size();

QByteArray riffSigRegion = headers.left(L_RIFF_SIG);
Expand Down
2 changes: 1 addition & 1 deletion src/wav.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class WAV

//-Class Functions------------------------------------------------------------------------------------------------------
public:
static bool fileIsValidWAV(QFile& possibleWAV, Qx::IO::IOOpReport reportBuffer);
static bool fileIsValidWAV(QFile& possibleWAV, Qx::IO::IOOpReport& reportBuffer);

private:

Expand Down

0 comments on commit 0a72e53

Please sign in to comment.