mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-26 15:20:29 +01:00
2021-05-28 Fred Gleason <fredg@paravelsystems.com>
* Fixed a use-after-delete bug in rdimport(1) that could cause a segfault when the '--fix-broken-formats' switch was given. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -20754,3 +20754,6 @@
|
||||
'Logitek vGuest', 'Livewire LWRP Audio', and 'Kernel GPIO'.
|
||||
2021-05-15 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Incremented the package version to 3.6.0.
|
||||
2021-05-28 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a use-after-delete bug in rdimport(1) that could cause
|
||||
a segfault when the '--fix-broken-formats' switch was given.
|
||||
|
||||
@@ -1006,7 +1006,7 @@ MainObject::Result MainObject::ImportFile(const QString &filename,
|
||||
//
|
||||
// Open the file
|
||||
//
|
||||
if(!OpenAudioFile(wavefile,wavedata)) {
|
||||
if(!OpenAudioFile(&wavefile,wavedata)) {
|
||||
delete wavedata;
|
||||
delete wavefile;
|
||||
return MainObject::FileBad;
|
||||
@@ -1442,16 +1442,16 @@ MainObject::Result MainObject::ImportFile(const QString &filename,
|
||||
}
|
||||
|
||||
|
||||
bool MainObject::OpenAudioFile(RDWaveFile *wavefile,RDWaveData *wavedata)
|
||||
bool MainObject::OpenAudioFile(RDWaveFile **wavefile,RDWaveData *wavedata)
|
||||
{
|
||||
QString orig_filename=wavefile->getName();
|
||||
QString orig_filename=(*wavefile)->getName();
|
||||
|
||||
if(!wavefile->openWave(wavedata)) {
|
||||
if(!(*wavefile)->openWave(wavedata)) {
|
||||
if(import_fix_broken_formats) {
|
||||
Log(LOG_WARNING,QString().sprintf(" File \"%s\" appears to be malformed, trying workaround ... ",
|
||||
RDGetBasePart(orig_filename).toUtf8().constData()));
|
||||
delete wavefile;
|
||||
if((wavefile=FixFile(orig_filename,wavedata))==NULL) {
|
||||
delete *wavefile;
|
||||
if(((*wavefile)=FixFile(orig_filename,wavedata))==NULL) {
|
||||
Log(LOG_WARNING,QString().sprintf("failed.\n"));
|
||||
Log(LOG_WARNING,QString().sprintf(
|
||||
" File \"%s\" is not readable or not a recognized format, skipping...\n",
|
||||
@@ -1473,7 +1473,7 @@ bool MainObject::OpenAudioFile(RDWaveFile *wavefile,RDWaveData *wavedata)
|
||||
else {
|
||||
Log(LOG_WARNING,QString().sprintf(
|
||||
" File \"%s\" is not readable or not a recognized format, skipping...\n",
|
||||
RDGetBasePart(wavefile->getName()).toUtf8().constData()));
|
||||
RDGetBasePart((*wavefile)->getName()).toUtf8().constData()));
|
||||
if(!import_run) {
|
||||
NormalExit();
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class MainObject : public QObject
|
||||
void RunDropBox();
|
||||
void ProcessFileEntry(const QString &entry);
|
||||
MainObject::Result ImportFile(const QString &filename,unsigned *cartnum);
|
||||
bool OpenAudioFile(RDWaveFile *wavefile,RDWaveData *wavedata);
|
||||
bool OpenAudioFile(RDWaveFile **wavefile,RDWaveData *wavedata);
|
||||
void VerifyFile(const QString &filename,unsigned *cartnum);
|
||||
RDWaveFile *FixFile(const QString &filename,RDWaveData *wavedata);
|
||||
bool IsWav(int fd);
|
||||
|
||||
Reference in New Issue
Block a user