Program: 192050
Project: 192050
Buggy source:
/** 
 * Composes the animation specs for all the tasks in the target stack.
 */
private List<AppTransitionAnimationSpec> composeAnimationSpecs(final Task task,final TaskStackView stackView,final int destinationStack){
  final int targetStackId=destinationStack != INVALID_STACK_ID ? destinationStack : task.key.stackId;
  if (!StackId.useAnimationSpecForAppTransition(targetStackId)) {
    return null;
  }
  float stackScroll=stackView.getScroller().getStackScroll();
  TaskView taskView=stackView.getChildViewForTask(task);
  TaskStackLayoutAlgorithm layoutAlgorithm=stackView.getStackAlgorithm();
  Rect offscreenTaskRect=new Rect(layoutAlgorithm.mTaskRect);
  offscreenTaskRect.offsetTo(offscreenTaskRect.left,layoutAlgorithm.mStackRect.bottom);
  List<AppTransitionAnimationSpec> specs=new ArrayList<>();
  if (targetStackId == FULLSCREEN_WORKSPACE_STACK_ID || targetStackId == DOCKED_STACK_ID || targetStackId == INVALID_STACK_ID) {
    if (taskView == null) {
      specs.add(composeOffscreenAnimationSpec(task,offscreenTaskRect));
    }
 else {
      layoutAlgorithm.getStackTransformScreenCoordinates(task,stackScroll,mTmpTransform,null);
      specs.add(composeAnimationSpec(stackView,taskView,mTmpTransform,true));
    }
    return specs;
  }
  TaskStack stack=stackView.getStack();
  ArrayList<Task> tasks=stack.getStackTasks();
  int taskCount=tasks.size();
  for (int i=taskCount - 1; i >= 0; i--) {
    Task t=tasks.get(i);
    if (t.isFreeformTask() || targetStackId == FREEFORM_WORKSPACE_STACK_ID) {
      TaskView tv=stackView.getChildViewForTask(t);
      if (tv == null) {
        specs.add(composeOffscreenAnimationSpec(t,offscreenTaskRect));
      }
 else {
        layoutAlgorithm.getStackTransformScreenCoordinates(t,stackScroll,mTmpTransform,null);
        specs.add(composeAnimationSpec(stackView,tv,mTmpTransform,true));
      }
    }
  }
  return specs;
}

Fixed version (ground truth):
/** 
 * Composes the animation specs for all the tasks in the target stack.
 */
private List<AppTransitionAnimationSpec> composeAnimationSpecs(final Task task,final TaskStackView stackView,final int destinationStack){
  final int targetStackId=destinationStack != INVALID_STACK_ID ? destinationStack : task.key.stackId;
  if (!StackId.useAnimationSpecForAppTransition(targetStackId)) {
    return null;
  }
  float stackScroll=stackView.getScroller().getStackScroll();
  TaskView taskView=stackView.getChildViewForTask(task);
  TaskStackLayoutAlgorithm stackLayout=stackView.getStackAlgorithm();
  Rect offscreenTaskRect=new Rect();
  stackLayout.getFrontOfStackTransform().rect.round(offscreenTaskRect);
  List<AppTransitionAnimationSpec> specs=new ArrayList<>();
  if (targetStackId == FULLSCREEN_WORKSPACE_STACK_ID || targetStackId == DOCKED_STACK_ID || targetStackId == INVALID_STACK_ID) {
    if (taskView == null) {
      specs.add(composeOffscreenAnimationSpec(task,offscreenTaskRect));
    }
 else {
      mTmpTransform.fillIn(taskView);
      stackLayout.transformToScreenCoordinates(mTmpTransform);
      specs.add(composeAnimationSpec(stackView,taskView,mTmpTransform,true));
    }
    return specs;
  }
  TaskStack stack=stackView.getStack();
  ArrayList<Task> tasks=stack.getStackTasks();
  int taskCount=tasks.size();
  for (int i=taskCount - 1; i >= 0; i--) {
    Task t=tasks.get(i);
    if (t.isFreeformTask() || targetStackId == FREEFORM_WORKSPACE_STACK_ID) {
      TaskView tv=stackView.getChildViewForTask(t);
      if (tv == null) {
        specs.add(composeOffscreenAnimationSpec(t,offscreenTaskRect));
      }
 else {
        mTmpTransform.fillIn(taskView);
        stackLayout.transformToScreenCoordinates(mTmpTransform);
        specs.add(composeAnimationSpec(stackView,tv,mTmpTransform,true));
      }
    }
  }
  return specs;
}