mirror of
				https://github.com/ElvishArtisan/rivendell.git
				synced 2025-11-03 23:53:59 +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:
		@@ -21721,3 +21721,6 @@
 | 
			
		||||
2021-05-28 Fred Gleason <fredg@paravelsystems.com>
 | 
			
		||||
	* Updated rddbmgr(8) to correctly recognize schema database
 | 
			
		||||
	schema 347 as belonging to v3.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.
 | 
			
		||||
 
 | 
			
		||||
@@ -1022,7 +1022,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;
 | 
			
		||||
@@ -1458,16 +1458,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",
 | 
			
		||||
@@ -1489,7 +1489,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