Program: 187166
Project: 187166
Buggy source:
public void doExportMedia(File fileExport,boolean doCompress,boolean doOverwrite) throws Exception {
  Message msg=mHandler.obtainMessage(0);
  msg.getData().putString("String_Node_Str","String_Node_Str");
  ArrayList<Media> mList=mProject.getMediaAsList();
  ArrayList<MediaDesc> alMediaIn=new ArrayList<MediaDesc>();
  ((StoryMakerApp)mActivity.getApplication()).isExternalStorageReady();
  ((StoryMakerApp)mActivity.getApplication()).killZombieProcs();
  Long totalBytesRequired=0l;
  for (  Media media : mList) {
    if (media == null || media.getPath() == null) {
    }
 else     if (!new File(media.getPath()).exists()) {
      throw new java.io.FileNotFoundException("String_Node_Str" + "String_Node_Str" + media.getPath());
    }
 else {
      File currentFile=new File(media.getPath());
      totalBytesRequired+=(long)currentFile.length();
    }
  }
  String memoryPath;
  if (mUseInternal) {
    memoryPath=Environment.getDataDirectory().getPath();
  }
 else {
    memoryPath=Environment.getExternalStorageDirectory().getPath();
  }
  StatFs stat=new StatFs(memoryPath);
  Long totalBytesAvailable=(long)stat.getAvailableBlocks() * (long)stat.getBlockSize();
  if (totalBytesRequired > totalBytesAvailable) {
    double totalMBRequired=totalBytesRequired / (double)(1024 * 1024);
    Utils.toastOnUiThread(mActivity,String.format("String_Node_Str",totalMBRequired),true);
    return;
  }
  File fileRenderTmpDir=getRenderPath(mContext);
  File fileRenderTmp=new File(fileRenderTmpDir,new Date().getTime() + "String_Node_Str");
  fileRenderTmp.mkdirs();
  if (mProject.getStoryType() == Project.STORY_TYPE_VIDEO) {
    int mIdx=0;
    for (    Media media : mList) {
      if (media != null) {
        MediaDesc mDesc=new MediaDesc();
        mDesc.mimeType=media.getMimeType();
        mDesc.path=new File(media.getPath()).getCanonicalPath();
        if (media.getTrimStart() > 0) {
          mDesc.startTime="String_Node_Str" + media.getTrimmedStartTime() / 1000F;
          mDesc.duration="String_Node_Str" + media.getTrimmedDuration() / 1000F;
        }
 else         if ((media.getTrimEnd() < 99) && media.getTrimEnd() > 0) {
          mDesc.duration="String_Node_Str" + media.getTrimmedDuration() / 1000F;
        }
        if (doCompress)         applyExportSettings(mDesc);
        applyExportSettingsResolution(mDesc);
        alMediaIn.add(mIdx,mDesc);
        mIdx++;
      }
    }
    mOut=new MediaDesc();
    if (doCompress)     applyExportSettings(mOut);
 else {
      mOut.audioCodec="String_Node_Str";
      mOut.audioBitrate=64;
    }
    applyExportSettingsResolution(mOut);
    mOut.mimeType=AppConstants.MimeTypes.MP4;
    mOut.path=fileExport.getCanonicalPath();
    String audioPath=null;
    File fileAudio=new File(getExternalProjectFolder(mProject,mContext),"String_Node_Str" + mScene.getId() + "String_Node_Str");
    if (fileAudio.exists())     audioPath=fileAudio.getCanonicalPath();
 else {
      fileAudio=new File(mContext.getExternalFilesDir(null),"String_Node_Str" + mScene.getId() + "String_Node_Str");
      if (fileAudio.exists())       audioPath=fileAudio.getCanonicalPath();
    }
    if ((!fileExport.exists()) || doOverwrite) {
      if (fileExport.exists())       fileExport.delete();
      fileExport.getParentFile().mkdirs();
      MediaVideoExporter mEx=new MediaVideoExporter(mContext,mHandler,alMediaIn,fileRenderTmp,mOut);
      if (audioPath != null) {
        MediaDesc audioTrack=new MediaDesc();
        audioTrack.path=audioPath;
        mEx.addAudioTrack(audioTrack);
      }
      mEx.export();
    }
  }
 else   if (mProject.getStoryType() == Project.STORY_TYPE_AUDIO) {
    int mIdx=0;
    for (    Media media : mList) {
      if (media != null) {
        MediaDesc mDesc=new MediaDesc();
        mDesc.mimeType=media.getMimeType();
        mDesc.path=media.getPath();
        if (media.getTrimStart() > 0) {
          mDesc.startTime="String_Node_Str" + media.getTrimmedStartTime() / 1000F;
          mDesc.duration="String_Node_Str" + media.getTrimmedDuration() / 1000F;
        }
 else         if ((media.getTrimEnd() < 99) && media.getTrimEnd() > 0) {
          mDesc.duration="String_Node_Str" + media.getTrimmedDuration() / 1000F;
        }
        if (doCompress)         applyExportSettings(mDesc);
        applyExportSettingsResolution(mDesc);
        alMediaIn.add(mIdx++,mDesc);
      }
    }
    mOut=new MediaDesc();
    mOut.mimeType=AppConstants.MimeTypes.THREEGPP_AUDIO;
    applyExportSettingsAudio(mOut);
    applyExportSettingsResolution(mOut);
    mOut.path=fileExport.getCanonicalPath();
    if ((!fileExport.exists()) || doOverwrite) {
      if (fileExport.exists())       fileExport.delete();
      fileExport.getParentFile().mkdirs();
      MediaAudioExporter mEx=new MediaAudioExporter(mContext,mHandler,alMediaIn,fileRenderTmp,mOut);
      mEx.export();
    }
  }
 else   if (mProject.getStoryType() == Project.STORY_TYPE_PHOTO) {
    for (    Media media : mList) {
      if (media == null)       continue;
      MediaDesc mDesc=new MediaDesc();
      mDesc.mimeType=media.getMimeType();
      mDesc.path=media.getPath();
      if (mDesc.path != null) {
        File fileSrc=new File(mDesc.path);
        if (fileSrc.exists()) {
          fileExport.getParentFile().mkdirs();
          fileExport.createNewFile();
          IOUtils.copy(new FileInputStream(fileSrc),new FileOutputStream(fileExport));
          mOut=new MediaDesc();
          mOut.path=fileExport.getCanonicalPath();
          mOut.mimeType=AppConstants.MimeTypes.JPEG;
          applyExportSettingsResolution(mOut);
          break;
        }
      }
    }
  }
 else   if (mProject.getStoryType() == Project.STORY_TYPE_ESSAY) {
    for (    Media media : mList) {
      if (media != null) {
        MediaDesc mDesc=new MediaDesc();
        mDesc.mimeType=media.getMimeType();
        File fileSrc=new File(media.getPath());
        File fileTmp=new File(fileRenderTmp,fileSrc.getName());
        if (!fileTmp.exists()) {
          fileTmp.getParentFile().mkdirs();
          fileTmp.createNewFile();
          IOUtils.copy(new FileInputStream(fileSrc),new FileOutputStream(fileTmp));
        }
        mDesc.path=fileTmp.getCanonicalPath();
        if (doCompress)         applyExportSettings(mDesc);
        applyExportSettingsResolution(mDesc);
        alMediaIn.add(mDesc);
      }
    }
    mOut=new MediaDesc();
    if (doCompress)     applyExportSettings(mOut);
    applyExportSettingsResolution(mOut);
    mOut.path=fileExport.getCanonicalPath();
    mOut.mimeType=AppConstants.MimeTypes.MP4;
    int slideDuration=Integer.parseInt(mSettings.getString("String_Node_Str",AppConstants.DEFAULT_SLIDE_DURATION + "String_Node_Str"));
    String audioPath=null;
    File fileAudio=new File(getExternalProjectFolder(mProject,mContext),"String_Node_Str" + mScene.getId() + "String_Node_Str");
    if (fileAudio.exists())     audioPath=fileAudio.getCanonicalPath();
 else {
      fileAudio=new File(mContext.getExternalFilesDir(null),"String_Node_Str" + mScene.getId() + "String_Node_Str");
      if (fileAudio.exists())       audioPath=fileAudio.getCanonicalPath();
    }
    if ((!fileExport.exists()) || doOverwrite) {
      if (fileExport.exists())       fileExport.delete();
      fileExport.getParentFile().mkdirs();
      MediaSlideshowExporter mEx=new MediaSlideshowExporter(mContext,mHandler,alMediaIn,fileRenderTmp,audioPath,slideDuration,mOut);
      mEx.export();
    }
  }
  deleteRecursive(fileRenderTmp,true);
}

Fixed version (ground truth):
public void doExportMedia(File fileExport,boolean doCompress,boolean doOverwrite) throws Exception {
  Message msg=mHandler.obtainMessage(0);
  msg.getData().putString("String_Node_Str","String_Node_Str");
  ArrayList<Media> mList=mProject.getMediaAsList();
  ArrayList<MediaDesc> alMediaIn=new ArrayList<MediaDesc>();
  ((StoryMakerApp)mActivity.getApplication()).isExternalStorageReady();
  ((StoryMakerApp)mActivity.getApplication()).killZombieProcs();
  Long totalBytesRequired=0l;
  for (  Media media : mList) {
    if (media == null || media.getPath() == null) {
    }
 else     if (!new File(media.getPath()).exists()) {
      throw new java.io.FileNotFoundException("String_Node_Str" + "String_Node_Str" + media.getPath());
    }
 else {
      File currentFile=new File(media.getPath());
      totalBytesRequired+=(long)currentFile.length();
    }
  }
  String memoryPath;
  if (mUseInternal) {
    memoryPath=Environment.getDataDirectory().getPath();
  }
 else {
    memoryPath=Environment.getExternalStorageDirectory().getPath();
  }
  StatFs stat=new StatFs(memoryPath);
  Long totalBytesAvailable=(long)stat.getAvailableBlocks() * (long)stat.getBlockSize();
  if (totalBytesRequired > totalBytesAvailable) {
    double totalMBRequired=totalBytesRequired / (double)(1024 * 1024);
    Utils.toastOnUiThread(mActivity,String.format("String_Node_Str",totalMBRequired),true);
    return;
  }
  File fileRenderTmpDir=getRenderPath(mContext);
  File fileRenderTmp=new File(fileRenderTmpDir,new Date().getTime() + "String_Node_Str");
  fileRenderTmp.mkdirs();
  if (mProject.getStoryType() == Project.STORY_TYPE_VIDEO) {
    int mIdx=0;
    for (    Media media : mList) {
      if (media != null) {
        MediaDesc mDesc=new MediaDesc();
        mDesc.mimeType=media.getMimeType();
        mDesc.path=new File(media.getPath()).getCanonicalPath();
        if (media.getTrimStart() > 0) {
          mDesc.startTime="String_Node_Str" + media.getTrimmedStartTimeFloat() / 1000F;
          mDesc.duration="String_Node_Str" + media.getTrimmedDuration() / 1000F;
        }
 else         if ((media.getTrimEnd() < 99) && media.getTrimEnd() > 0) {
          mDesc.duration="String_Node_Str" + media.getTrimmedDuration() / 1000F;
        }
        if (doCompress)         applyExportSettings(mDesc);
        applyExportSettingsResolution(mDesc);
        alMediaIn.add(mIdx,mDesc);
        mIdx++;
      }
    }
    mOut=new MediaDesc();
    if (doCompress)     applyExportSettings(mOut);
 else {
      mOut.audioCodec="String_Node_Str";
      mOut.audioBitrate=64;
    }
    applyExportSettingsResolution(mOut);
    mOut.mimeType=AppConstants.MimeTypes.MP4;
    mOut.path=fileExport.getCanonicalPath();
    String audioPath=null;
    File fileAudio=new File(getExternalProjectFolder(mProject,mContext),"String_Node_Str" + mScene.getId() + "String_Node_Str");
    if (fileAudio.exists())     audioPath=fileAudio.getCanonicalPath();
 else {
      fileAudio=new File(mContext.getExternalFilesDir(null),"String_Node_Str" + mScene.getId() + "String_Node_Str");
      if (fileAudio.exists())       audioPath=fileAudio.getCanonicalPath();
    }
    if ((!fileExport.exists()) || doOverwrite) {
      if (fileExport.exists())       fileExport.delete();
      fileExport.getParentFile().mkdirs();
      MediaVideoExporter mEx=new MediaVideoExporter(mContext,mHandler,alMediaIn,fileRenderTmp,mOut);
      if (audioPath != null) {
        MediaDesc audioTrack=new MediaDesc();
        audioTrack.path=audioPath;
        mEx.addAudioTrack(audioTrack);
      }
      mEx.export();
    }
  }
 else   if (mProject.getStoryType() == Project.STORY_TYPE_AUDIO) {
    int mIdx=0;
    for (    Media media : mList) {
      if (media != null) {
        MediaDesc mDesc=new MediaDesc();
        mDesc.mimeType=media.getMimeType();
        mDesc.path=media.getPath();
        if (media.getTrimStart() > 0) {
          mDesc.startTime="String_Node_Str" + media.getTrimmedStartTimeFloat() / 1000F;
          mDesc.duration="String_Node_Str" + media.getTrimmedDuration() / 1000F;
        }
 else         if ((media.getTrimEnd() < 99) && media.getTrimEnd() > 0) {
          mDesc.duration="String_Node_Str" + media.getTrimmedDuration() / 1000F;
        }
        if (doCompress)         applyExportSettings(mDesc);
        applyExportSettingsResolution(mDesc);
        alMediaIn.add(mIdx++,mDesc);
      }
    }
    mOut=new MediaDesc();
    mOut.mimeType=AppConstants.MimeTypes.THREEGPP_AUDIO;
    applyExportSettingsAudio(mOut);
    applyExportSettingsResolution(mOut);
    mOut.path=fileExport.getCanonicalPath();
    if ((!fileExport.exists()) || doOverwrite) {
      if (fileExport.exists())       fileExport.delete();
      fileExport.getParentFile().mkdirs();
      MediaAudioExporter mEx=new MediaAudioExporter(mContext,mHandler,alMediaIn,fileRenderTmp,mOut);
      mEx.export();
    }
  }
 else   if (mProject.getStoryType() == Project.STORY_TYPE_PHOTO) {
    for (    Media media : mList) {
      if (media == null)       continue;
      MediaDesc mDesc=new MediaDesc();
      mDesc.mimeType=media.getMimeType();
      mDesc.path=media.getPath();
      if (mDesc.path != null) {
        File fileSrc=new File(mDesc.path);
        if (fileSrc.exists()) {
          fileExport.getParentFile().mkdirs();
          fileExport.createNewFile();
          IOUtils.copy(new FileInputStream(fileSrc),new FileOutputStream(fileExport));
          mOut=new MediaDesc();
          mOut.path=fileExport.getCanonicalPath();
          mOut.mimeType=AppConstants.MimeTypes.JPEG;
          applyExportSettingsResolution(mOut);
          break;
        }
      }
    }
  }
 else   if (mProject.getStoryType() == Project.STORY_TYPE_ESSAY) {
    for (    Media media : mList) {
      if (media != null) {
        MediaDesc mDesc=new MediaDesc();
        mDesc.mimeType=media.getMimeType();
        File fileSrc=new File(media.getPath());
        File fileTmp=new File(fileRenderTmp,fileSrc.getName());
        if (!fileTmp.exists()) {
          fileTmp.getParentFile().mkdirs();
          fileTmp.createNewFile();
          IOUtils.copy(new FileInputStream(fileSrc),new FileOutputStream(fileTmp));
        }
        mDesc.path=fileTmp.getCanonicalPath();
        if (doCompress)         applyExportSettings(mDesc);
        applyExportSettingsResolution(mDesc);
        alMediaIn.add(mDesc);
      }
    }
    mOut=new MediaDesc();
    if (doCompress)     applyExportSettings(mOut);
    applyExportSettingsResolution(mOut);
    mOut.path=fileExport.getCanonicalPath();
    mOut.mimeType=AppConstants.MimeTypes.MP4;
    int slideDuration=Integer.parseInt(mSettings.getString("String_Node_Str",AppConstants.DEFAULT_SLIDE_DURATION + "String_Node_Str"));
    String audioPath=null;
    File fileAudio=new File(getExternalProjectFolder(mProject,mContext),"String_Node_Str" + mScene.getId() + "String_Node_Str");
    if (fileAudio.exists())     audioPath=fileAudio.getCanonicalPath();
 else {
      fileAudio=new File(mContext.getExternalFilesDir(null),"String_Node_Str" + mScene.getId() + "String_Node_Str");
      if (fileAudio.exists())       audioPath=fileAudio.getCanonicalPath();
    }
    if ((!fileExport.exists()) || doOverwrite) {
      if (fileExport.exists())       fileExport.delete();
      fileExport.getParentFile().mkdirs();
      MediaSlideshowExporter mEx=new MediaSlideshowExporter(mContext,mHandler,alMediaIn,fileRenderTmp,audioPath,slideDuration,mOut);
      mEx.export();
    }
  }
  deleteRecursive(fileRenderTmp,true);
}