Program: 13921
Project: 13921
Buggy source:
@Override public void appendMediaFile(final MediaFile mediaFile,final String mediaUrl,ImageLoader imageLoader){
  final String safeMediaUrl=Utils.escapeQuotes(mediaUrl);
  if (URLUtil.isNetworkUrl(mediaUrl)) {
    if (mediaFile.isVideo()) {
      ToastUtils.showToast(getActivity(),R.string.media_insert_unimplemented);
    }
 else {
      ToastUtils.showToast(getActivity(),R.string.media_insert_unimplemented);
    }
    mActionStartedAt=System.currentTimeMillis();
  }
 else {
    String localMediaId=String.valueOf(mediaFile.getId());
    if (mediaFile.isVideo()) {
      ToastUtils.showToast(getActivity(),R.string.media_insert_unimplemented);
    }
 else {
      AttributesImpl attrs=new AttributesImpl();
      attrs.addAttribute("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",localMediaId);
      attrs.addAttribute("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",safeMediaUrl);
      int maxWidth=DisplayUtils.getDisplayPixelWidth(getActivity());
      Bitmap bitmapToShow=ImageUtils.getWPImageSpanThumbnailFromFilePath(getActivity(),safeMediaUrl,maxWidth);
      if (bitmapToShow == null) {
        ToastUtils.showToast(getActivity(),R.string.error_media_load);
        bitmapToShow=BitmapFactory.decodeResource(getResources(),R.drawable.ic_gridicons_image);
      }
      content.insertMedia(new BitmapDrawable(getResources(),bitmapToShow),attrs);
      content.setOverlay(ImagePredicate.localMediaIdPredicate(localMediaId),0,new ColorDrawable(getResources().getColor(R.color.media_shade_overlay_color)),Gravity.FILL,attrs);
      Drawable progressDrawable=getResources().getDrawable(android.R.drawable.progress_horizontal);
      progressDrawable.setBounds(0,0,0,4);
      content.setOverlay(ImagePredicate.localMediaIdPredicate(localMediaId),1,progressDrawable,Gravity.FILL_HORIZONTAL | Gravity.TOP,attrs);
      content.refreshText();
      mUploadingMedia.put(localMediaId,MediaType.IMAGE);
    }
  }
}

Fixed version (ground truth):
@Override public void appendMediaFile(final MediaFile mediaFile,final String mediaUrl,ImageLoader imageLoader){
  final String safeMediaUrl=Utils.escapeQuotes(mediaUrl);
  if (URLUtil.isNetworkUrl(mediaUrl)) {
    if (mediaFile.isVideo()) {
      ToastUtils.showToast(getActivity(),R.string.media_insert_unimplemented);
    }
 else {
      ToastUtils.showToast(getActivity(),R.string.media_insert_unimplemented);
    }
    mActionStartedAt=System.currentTimeMillis();
  }
 else {
    String localMediaId=String.valueOf(mediaFile.getId());
    if (mediaFile.isVideo()) {
      ToastUtils.showToast(getActivity(),R.string.media_insert_unimplemented);
    }
 else {
      AttributesImpl attrs=new AttributesImpl();
      attrs.addAttribute("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",localMediaId);
      attrs.addAttribute("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",safeMediaUrl);
      int maxWidth=DisplayUtils.getDisplayPixelWidth(getActivity());
      Bitmap bitmapToShow=ImageUtils.getWPImageSpanThumbnailFromFilePath(getActivity(),safeMediaUrl,maxWidth);
      if (bitmapToShow != null) {
        content.insertMedia(new BitmapDrawable(getResources(),bitmapToShow),attrs);
      }
 else {
        ToastUtils.showToast(getActivity(),R.string.error_media_load);
        Drawable d=getResources().getDrawable(R.drawable.ic_gridicons_image);
        d.setBounds(0,0,maxWidth,maxWidth);
        content.insertMedia(d,attrs);
      }
      content.setOverlay(ImagePredicate.localMediaIdPredicate(localMediaId),0,new ColorDrawable(getResources().getColor(R.color.media_shade_overlay_color)),Gravity.FILL,attrs);
      Drawable progressDrawable=getResources().getDrawable(android.R.drawable.progress_horizontal);
      progressDrawable.setBounds(0,0,0,4);
      content.setOverlay(ImagePredicate.localMediaIdPredicate(localMediaId),1,progressDrawable,Gravity.FILL_HORIZONTAL | Gravity.TOP,attrs);
      content.refreshText();
      mUploadingMedia.put(localMediaId,MediaType.IMAGE);
    }
  }
}