Program: 107656
Project: 107656
Buggy source:
/** 
 * Handles attributes contained in <tt>MediaFormat</tt>.
 * @param format the <tt>MediaFormat</tt> to handle the attributes of
 * @param attrs the attributes <tt>Map</tt> to handle
 */
@Override protected void handleAttributes(MediaFormat format,Map<String,String> attrs){
  if (attrs != null) {
    String width=null;
    String height=null;
    for (    Map.Entry<String,String> attr : attrs.entrySet()) {
      String key=attr.getKey();
      String value=attr.getValue();
      if (key.equals("String_Node_Str")) {
        if (value.equals("String_Node_Str"))         usePLI=true;
      }
 else       if (key.equals("String_Node_Str")) {
        if ((attrs.containsKey("String_Node_Str") || attrs.containsKey("String_Node_Str")) && (outputSize != null)) {
          continue;
        }
        Dimension res[]=parseSendRecvResolution(value);
        if (res != null) {
          outputSize=res[1];
          qualityControl.setRemoteSendMaxPreset(new QualityPreset(res[0]));
          qualityControl.setRemoteReceiveResolution(outputSize);
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
 else       if (key.equals("String_Node_Str")) {
        Dimension dim=new Dimension(352,288);
        if ((outputSize == null) || ((outputSize.width < dim.width) && (outputSize.height < dim.height))) {
          outputSize=dim;
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
 else       if (key.equals("String_Node_Str")) {
        Dimension dim=new Dimension(176,144);
        if ((outputSize == null) || ((outputSize.width < dim.width) && (outputSize.height < dim.height))) {
          outputSize=dim;
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
 else       if (key.equals("String_Node_Str")) {
        Dimension dim=new Dimension(640,480);
        if ((outputSize == null) || ((outputSize.width < dim.width) && (outputSize.height < dim.height))) {
          outputSize=dim;
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
 else       if (key.equals("String_Node_Str")) {
        String args[]=value.split("String_Node_Str");
        if (args.length < 3)         continue;
        try {
          Dimension dim=new Dimension(Integer.parseInt(args[0]),Integer.parseInt(args[1]));
          if ((outputSize == null) || ((outputSize.width < dim.width) && (outputSize.height < dim.height))) {
            outputSize=dim;
            ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
          }
        }
 catch (        Exception e) {
        }
      }
 else       if (key.equals("String_Node_Str")) {
        width=value;
        if (height != null) {
          outputSize=new Dimension(Integer.parseInt(width),Integer.parseInt(height));
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
 else       if (key.equals("String_Node_Str")) {
        height=value;
        if (width != null) {
          outputSize=new Dimension(Integer.parseInt(width),Integer.parseInt(height));
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Handles attributes contained in <tt>MediaFormat</tt>.
 * @param format the <tt>MediaFormat</tt> to handle the attributes of
 * @param attrs the attributes <tt>Map</tt> to handle
 */
@Override protected void handleAttributes(MediaFormat format,Map<String,String> attrs){
  if (attrs != null) {
    String width=null;
    String height=null;
    for (    Map.Entry<String,String> attr : attrs.entrySet()) {
      String key=attr.getKey();
      String value=attr.getValue();
      if (key.equals("String_Node_Str")) {
        if (value.equals("String_Node_Str"))         ;
      }
 else       if (key.equals("String_Node_Str")) {
        if ((attrs.containsKey("String_Node_Str") || attrs.containsKey("String_Node_Str")) && (outputSize != null)) {
          continue;
        }
        Dimension res[]=parseSendRecvResolution(value);
        if (res != null) {
          outputSize=res[1];
          qualityControl.setRemoteSendMaxPreset(new QualityPreset(res[0]));
          qualityControl.setRemoteReceiveResolution(outputSize);
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
 else       if (key.equals("String_Node_Str")) {
        Dimension dim=new Dimension(352,288);
        if ((outputSize == null) || ((outputSize.width < dim.width) && (outputSize.height < dim.height))) {
          outputSize=dim;
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
 else       if (key.equals("String_Node_Str")) {
        Dimension dim=new Dimension(176,144);
        if ((outputSize == null) || ((outputSize.width < dim.width) && (outputSize.height < dim.height))) {
          outputSize=dim;
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
 else       if (key.equals("String_Node_Str")) {
        Dimension dim=new Dimension(640,480);
        if ((outputSize == null) || ((outputSize.width < dim.width) && (outputSize.height < dim.height))) {
          outputSize=dim;
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
 else       if (key.equals("String_Node_Str")) {
        String args[]=value.split("String_Node_Str");
        if (args.length < 3)         continue;
        try {
          Dimension dim=new Dimension(Integer.parseInt(args[0]),Integer.parseInt(args[1]));
          if ((outputSize == null) || ((outputSize.width < dim.width) && (outputSize.height < dim.height))) {
            outputSize=dim;
            ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
          }
        }
 catch (        Exception e) {
        }
      }
 else       if (key.equals("String_Node_Str")) {
        width=value;
        if (height != null) {
          outputSize=new Dimension(Integer.parseInt(width),Integer.parseInt(height));
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
 else       if (key.equals("String_Node_Str")) {
        height=value;
        if (width != null) {
          outputSize=new Dimension(Integer.parseInt(width),Integer.parseInt(height));
          ((VideoMediaDeviceSession)getDeviceSession()).setOutputSize(outputSize);
        }
      }
    }
  }
}