Program: 47077
Project: 47077
Buggy source:
@Override protected void resolveOnce(){
  String cmd[]=new String[]{configuration.getMplayerPath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",ProcessUtil.getShortFileNameIfWideChars(file.getAbsolutePath()),"String_Node_Str" + title};
  OutputParams params=new OutputParams(configuration);
  params.maxBufferSize=1;
  if (configuration.isDvdIsoThumbnails()) {
    try {
      params.workDir=configuration.getTempFolder();
    }
 catch (    IOException e1) {
      LOGGER.debug("String_Node_Str",e1);
    }
    cmd[2]="String_Node_Str";
    cmd[3]="String_Node_Str";
    cmd[7]="String_Node_Str";
    cmd[8]="String_Node_Str";
    String frameName="String_Node_Str" + this.hashCode();
    frameName="String_Node_Str" + frameName + "String_Node_Str";
    frameName=frameName.replace(',','_');
    cmd[10]="String_Node_Str" + frameName;
  }
  params.log=true;
  final ProcessWrapperImpl pw=new ProcessWrapperImpl(cmd,params,true,false);
  Runnable r=new Runnable(){
    @Override public void run(){
      try {
        Thread.sleep(10000);
      }
 catch (      InterruptedException e) {
      }
      pw.stopProcess();
    }
  }
;
  Thread failsafe=new Thread(r,"String_Node_Str");
  failsafe.start();
  pw.runInSameThread();
  List<String> lines=pw.getOtherResults();
  String duration=null;
  int nbsectors=0;
  String fps=null;
  String aspect=null;
  String width=null;
  String height=null;
  ArrayList<DLNAMediaAudio> audio=new ArrayList<>();
  ArrayList<DLNAMediaSubtitle> subs=new ArrayList<>();
  if (lines != null) {
    for (    String line : lines) {
      if (line.startsWith("String_Node_Str")) {
        nbsectors=Integer.parseInt(line.substring(line.lastIndexOf('=') + 1).trim());
      }
      if (line.startsWith("String_Node_Str")) {
        DLNAMediaAudio lang=new DLNAMediaAudio();
        lang.setId(Integer.parseInt(line.substring(line.indexOf("String_Node_Str") + 5,line.lastIndexOf('.')).trim()));
        lang.setLang(line.substring(line.indexOf("String_Node_Str") + 10,line.lastIndexOf("String_Node_Str")).trim());
        int end=line.lastIndexOf("String_Node_Str");
        if (line.lastIndexOf('(') < end && line.lastIndexOf('(') > line.indexOf("String_Node_Str")) {
          end=line.lastIndexOf('(');
        }
        lang.setCodecA(line.substring(line.indexOf("String_Node_Str") + 8,end).trim());
        if (line.contains("String_Node_Str")) {
          lang.getAudioProperties().setNumberOfChannels(2);
        }
 else {
          lang.getAudioProperties().setNumberOfChannels(6);
        }
        audio.add(lang);
      }
      if (line.startsWith("String_Node_Str")) {
        DLNAMediaSubtitle lang=new DLNAMediaSubtitle();
        lang.setId(Integer.parseInt(line.substring(line.indexOf("String_Node_Str") + 3,line.lastIndexOf("String_Node_Str")).trim()));
        lang.setLang(line.substring(line.indexOf("String_Node_Str") + 10).trim());
        if (lang.getLang().equals("String_Node_Str")) {
          lang.setLang(DLNAMediaLang.UND);
        }
        lang.setType(SubtitleType.UNKNOWN);
        subs.add(lang);
      }
      if (line.startsWith("String_Node_Str")) {
        width=line.substring(line.indexOf("String_Node_Str") + 15).trim();
      }
      if (line.startsWith("String_Node_Str")) {
        height=line.substring(line.indexOf("String_Node_Str") + 16).trim();
      }
      if (line.startsWith("String_Node_Str")) {
        fps=line.substring(line.indexOf("String_Node_Str") + 13).trim();
      }
      if (line.startsWith("String_Node_Str")) {
        duration=line.substring(line.indexOf("String_Node_Str") + 10).trim();
      }
      if (line.startsWith("String_Node_Str")) {
        aspect=line.substring(line.indexOf("String_Node_Str") + 16).trim();
      }
    }
  }
  if (configuration.isDvdIsoThumbnails()) {
    try {
      String frameName="String_Node_Str" + this.hashCode();
      frameName=configuration.getTempFolder() + "String_Node_Str" + frameName+ "String_Node_Str";
      frameName=frameName.replace(',','_');
      File jpg=new File(frameName + "String_Node_Str");
      if (jpg.exists()) {
        try (InputStream is=new FileInputStream(jpg)){
          int sz=is.available();
          if (sz > 0) {
            getMedia().setThumb(new byte[sz]);
            is.read(getMedia().getThumb());
          }
        }
         if (!jpg.delete()) {
          jpg.deleteOnExit();
        }
        if (!jpg.getParentFile().delete() && !jpg.getParentFile().delete()) {
          LOGGER.debug("String_Node_Str" + jpg.getParentFile().getAbsolutePath() + "String_Node_Str");
        }
      }
      jpg=new File(frameName + "String_Node_Str");
      if (jpg.exists()) {
        if (!jpg.delete()) {
          jpg.deleteOnExit();
        }
        if (!jpg.getParentFile().delete()) {
          jpg.getParentFile().delete();
        }
      }
    }
 catch (    IOException e) {
      LOGGER.trace("String_Node_Str" + e.getMessage());
    }
  }
  length=nbsectors * 2048;
  double d=0;
  if (duration != null) {
    d=Double.parseDouble(duration);
  }
  getMedia().setAudioTracksList(audio);
  getMedia().setSubtitleTracksList(subs);
  if (duration != null) {
    getMedia().setDuration(d);
  }
  getMedia().setFrameRate(fps);
  getMedia().setAspectRatioDvdIso(aspect);
  getMedia().setDvdtrack(title);
  getMedia().setContainer("String_Node_Str");
  getMedia().setCodecV("String_Node_Str");
  try {
    getMedia().setWidth(Integer.parseInt(width));
  }
 catch (  NumberFormatException nfe) {
    LOGGER.debug("String_Node_Str" + width + "String_Node_Str");
  }
  try {
    getMedia().setHeight(Integer.parseInt(height));
  }
 catch (  NumberFormatException nfe) {
    LOGGER.debug("String_Node_Str" + height + "String_Node_Str");
  }
  getMedia().setMediaparsed(true);
}

Fixed version (ground truth):
@Override protected void resolveOnce(){
  String cmd[]=new String[]{configuration.getMplayerPath(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",ProcessUtil.getShortFileNameIfWideChars(file.getAbsolutePath()),"String_Node_Str" + title};
  OutputParams params=new OutputParams(configuration);
  params.maxBufferSize=1;
  if (configuration.isDvdIsoThumbnails()) {
    try {
      params.workDir=configuration.getTempFolder();
    }
 catch (    IOException e1) {
      LOGGER.debug("String_Node_Str",e1);
    }
    cmd[2]="String_Node_Str";
    cmd[3]="String_Node_Str";
    cmd[7]="String_Node_Str";
    cmd[8]="String_Node_Str";
    String frameName="String_Node_Str" + this.hashCode();
    frameName="String_Node_Str" + frameName + "String_Node_Str";
    frameName=frameName.replace(',','_');
    cmd[10]="String_Node_Str" + frameName;
  }
  params.log=true;
  final ProcessWrapperImpl pw=new ProcessWrapperImpl(cmd,params,true,false);
  Runnable r=new Runnable(){
    @Override public void run(){
      try {
        Thread.sleep(10000);
      }
 catch (      InterruptedException e) {
      }
      pw.stopProcess();
    }
  }
;
  Thread failsafe=new Thread(r,"String_Node_Str");
  failsafe.start();
  pw.runInSameThread();
  List<String> lines=pw.getOtherResults();
  String duration=null;
  int nbsectors=0;
  String fps=null;
  String aspect=null;
  String width=null;
  String height=null;
  ArrayList<DLNAMediaAudio> audio=new ArrayList<>();
  ArrayList<DLNAMediaSubtitle> subs=new ArrayList<>();
  if (lines != null) {
    for (    String line : lines) {
      if (line.startsWith("String_Node_Str")) {
        nbsectors=Integer.parseInt(line.substring(line.lastIndexOf('=') + 1).trim());
      }
      if (line.startsWith("String_Node_Str")) {
        DLNAMediaAudio lang=new DLNAMediaAudio();
        lang.setId(Integer.parseInt(line.substring(line.indexOf("String_Node_Str") + 5,line.lastIndexOf('.')).trim()));
        lang.setLang(line.substring(line.indexOf("String_Node_Str") + 10,line.lastIndexOf("String_Node_Str")).trim());
        int end=line.lastIndexOf("String_Node_Str");
        if (line.lastIndexOf('(') < end && line.lastIndexOf('(') > line.indexOf("String_Node_Str")) {
          end=line.lastIndexOf('(');
        }
        lang.setCodecA(line.substring(line.indexOf("String_Node_Str") + 8,end).trim());
        if (line.contains("String_Node_Str")) {
          lang.getAudioProperties().setNumberOfChannels(2);
        }
 else {
          lang.getAudioProperties().setNumberOfChannels(6);
        }
        audio.add(lang);
      }
      if (line.startsWith("String_Node_Str")) {
        DLNAMediaSubtitle lang=new DLNAMediaSubtitle();
        lang.setId(Integer.parseInt(line.substring(line.indexOf("String_Node_Str") + 3,line.lastIndexOf("String_Node_Str")).trim()));
        lang.setLang(line.substring(line.indexOf("String_Node_Str") + 10).trim());
        if (lang.getLang().equals("String_Node_Str")) {
          lang.setLang(DLNAMediaLang.UND);
        }
        lang.setType(SubtitleType.UNKNOWN);
        subs.add(lang);
      }
      if (line.startsWith("String_Node_Str")) {
        width=line.substring(line.indexOf("String_Node_Str") + 15).trim();
      }
      if (line.startsWith("String_Node_Str")) {
        height=line.substring(line.indexOf("String_Node_Str") + 16).trim();
      }
      if (line.startsWith("String_Node_Str")) {
        fps=line.substring(line.indexOf("String_Node_Str") + 13).trim();
      }
      if (line.startsWith("String_Node_Str")) {
        duration=line.substring(line.indexOf("String_Node_Str") + 10).trim();
      }
      if (line.startsWith("String_Node_Str")) {
        aspect=line.substring(line.indexOf("String_Node_Str") + 16).trim();
      }
    }
  }
  if (configuration.isDvdIsoThumbnails()) {
    try {
      String frameName="String_Node_Str" + this.hashCode();
      frameName=configuration.getTempFolder() + "String_Node_Str" + frameName+ "String_Node_Str";
      frameName=frameName.replace(',','_');
      File jpg=new File(frameName + "String_Node_Str");
      if (jpg.exists()) {
        try (InputStream is=new FileInputStream(jpg)){
          int sz=is.available();
          if (sz > 0) {
            byte[] thumb=new byte[sz];
            is.read(thumb);
            getMedia().setThumb(thumb);
          }
        }
         if (!jpg.delete()) {
          jpg.deleteOnExit();
        }
        if (!jpg.getParentFile().delete() && !jpg.getParentFile().delete()) {
          LOGGER.debug("String_Node_Str" + jpg.getParentFile().getAbsolutePath() + "String_Node_Str");
        }
      }
      jpg=new File(frameName + "String_Node_Str");
      if (jpg.exists()) {
        if (!jpg.delete()) {
          jpg.deleteOnExit();
        }
        if (!jpg.getParentFile().delete()) {
          jpg.getParentFile().delete();
        }
      }
    }
 catch (    IOException e) {
      LOGGER.trace("String_Node_Str" + e.getMessage());
    }
  }
  length=nbsectors * 2048;
  double d=0;
  if (duration != null) {
    d=Double.parseDouble(duration);
  }
  getMedia().setAudioTracksList(audio);
  getMedia().setSubtitleTracksList(subs);
  if (duration != null) {
    getMedia().setDuration(d);
  }
  getMedia().setFrameRate(fps);
  getMedia().setAspectRatioDvdIso(aspect);
  getMedia().setDvdtrack(title);
  getMedia().setContainer("String_Node_Str");
  getMedia().setCodecV("String_Node_Str");
  try {
    getMedia().setWidth(Integer.parseInt(width));
  }
 catch (  NumberFormatException nfe) {
    LOGGER.debug("String_Node_Str" + width + "String_Node_Str");
  }
  try {
    getMedia().setHeight(Integer.parseInt(height));
  }
 catch (  NumberFormatException nfe) {
    LOGGER.debug("String_Node_Str" + height + "String_Node_Str");
  }
  getMedia().setMediaparsed(true);
}