Program: 15231
Project: 15231
Buggy source:
private static void startImg(SpannableStringBuilder text,Attributes attributes,WPHtml.ImageGetter img){
  String src=attributes.getValue("String_Node_Str");
  Bitmap resizedBitmap=null;
  Display display=((WindowManager)ctx.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
  int width=display.getWidth();
  ImageHelper ih=new ImageHelper();
  HashMap<String,Object> mediaData=ih.getImageBytesForPath(src,ctx);
  if (mediaData != null) {
    byte[] finalBytes=ih.createThumbnail((byte[])mediaData.get("String_Node_Str"),String.valueOf(width / 2),(String)mediaData.get("String_Node_Str"),true);
    resizedBitmap=BitmapFactory.decodeByteArray(finalBytes,0,finalBytes.length);
    int len=text.length();
    text.append("String_Node_Str");
    Uri curStream=Uri.parse(src);
    if (curStream == null) {
      return;
    }
    WPImageSpan is=new WPImageSpan(ctx,resizedBitmap,curStream);
    MediaFile mf=WordPress.wpDB.getMediaFile(src,post);
    if (mf != null) {
      is.setTitle(mf.getTitle());
      is.setDescription(mf.getDescription());
      is.setCaption(mf.getCaption());
      is.setFeatured(mf.isFeatured());
      is.setHorizontalAlignment(mf.getHorizontalAlignment());
      is.setImageSource(curStream);
      is.setWidth(mf.getWidth());
      is.setVideo(mf.isVideo());
    }
    text.setSpan(is,len,text.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
  }
 else {
    if (attributes != null) {
      text.append("String_Node_Str");
      for (int i=0; i < attributes.getLength(); i++) {
        String aName=attributes.getLocalName(i);
        if ("String_Node_Str".equals(aName))         aName=attributes.getQName(i);
        text.append("String_Node_Str");
        text.append(aName + "String_Node_Str" + attributes.getValue(i)+ "String_Node_Str");
      }
      text.append("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private static void startImg(SpannableStringBuilder text,Attributes attributes,WPHtml.ImageGetter img){
  String src=attributes.getValue("String_Node_Str");
  Bitmap resizedBitmap=null;
  Display display=((WindowManager)ctx.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
  int width=display.getWidth();
  ImageHelper ih=new ImageHelper();
  HashMap<String,Object> mediaData=ih.getImageBytesForPath(src,ctx);
  if (mediaData != null) {
    byte[] finalBytes=ih.createThumbnail((byte[])mediaData.get("String_Node_Str"),String.valueOf(width / 2),(String)mediaData.get("String_Node_Str"),true);
    resizedBitmap=BitmapFactory.decodeByteArray(finalBytes,0,finalBytes.length);
    int len=text.length();
    text.append("String_Node_Str");
    Uri curStream=Uri.parse(src);
    if (curStream == null) {
      return;
    }
    WPImageSpan is=new WPImageSpan(ctx,resizedBitmap,curStream);
    MediaFile mf=WordPress.wpDB.getMediaFile(src,post);
    if (mf != null) {
      is.setTitle(mf.getTitle());
      is.setDescription(mf.getDescription());
      is.setCaption(mf.getCaption());
      is.setFeatured(mf.isFeatured());
      is.setHorizontalAlignment(mf.getHorizontalAlignment());
      is.setImageSource(curStream);
      is.setWidth(mf.getWidth());
      is.setVideo(mf.isVideo());
      text.setSpan(is,len,text.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    }
  }
 else {
    if (attributes != null) {
      text.append("String_Node_Str");
      for (int i=0; i < attributes.getLength(); i++) {
        String aName=attributes.getLocalName(i);
        if ("String_Node_Str".equals(aName))         aName=attributes.getQName(i);
        text.append("String_Node_Str");
        text.append(aName + "String_Node_Str" + attributes.getValue(i)+ "String_Node_Str");
      }
      text.append("String_Node_Str");
    }
  }
}