Program: 116821
Project: 116821
Buggy source:
@Override public void onManifest(String contentId,MediaPresentationDescription manifest){
  Handler mainHandler=player.getMainHandler();
  LoadControl loadControl=new DefaultLoadControl(new BufferPool(BUFFER_SEGMENT_SIZE));
  DefaultBandwidthMeter bandwidthMeter=new DefaultBandwidthMeter(mainHandler,player);
  int maxDecodableFrameSize=MediaCodecUtil.maxH264DecodableFrameSize();
  ArrayList<Representation> audioRepresentationsList=new ArrayList<Representation>();
  ArrayList<Representation> videoRepresentationsList=new ArrayList<Representation>();
  Period period=manifest.periods.get(0);
  boolean hasContentProtection=false;
  for (int i=0; i < period.adaptationSets.size(); i++) {
    AdaptationSet adaptationSet=period.adaptationSets.get(i);
    hasContentProtection|=adaptationSet.hasContentProtection();
    int adaptationSetType=adaptationSet.type;
    for (int j=0; j < adaptationSet.representations.size(); j++) {
      Representation representation=adaptationSet.representations.get(j);
      if (adaptationSetType == AdaptationSet.TYPE_AUDIO) {
        audioRepresentationsList.add(representation);
      }
 else       if (adaptationSetType == AdaptationSet.TYPE_VIDEO) {
        Format format=representation.format;
        if (format.width * format.height <= maxDecodableFrameSize) {
          videoRepresentationsList.add(representation);
        }
 else {
        }
      }
    }
  }
  Representation[] videoRepresentations=new Representation[videoRepresentationsList.size()];
  videoRepresentationsList.toArray(videoRepresentations);
  DrmSessionManager drmSessionManager=null;
  if (hasContentProtection) {
    if (Util.SDK_INT < 18) {
      callback.onRenderersError(new UnsupportedOperationException("String_Node_Str" + Util.SDK_INT));
      return;
    }
    try {
      Pair<DrmSessionManager,Boolean> drmSessionManagerData=V18Compat.getDrmSessionManagerData(player,drmCallback);
      drmSessionManager=drmSessionManagerData.first;
      if (!drmSessionManagerData.second) {
        videoRepresentations=getSdRepresentations(videoRepresentations);
      }
    }
 catch (    Exception e) {
      callback.onRenderersError(e);
      return;
    }
  }
  DataSource videoDataSource=new HttpDataSource(userAgent,HttpDataSource.REJECT_PAYWALL_TYPES,bandwidthMeter);
  ChunkSource videoChunkSource;
  String mimeType=videoRepresentations[0].format.mimeType;
  if (mimeType.equals(MimeTypes.VIDEO_MP4)) {
    videoChunkSource=new DashMp4ChunkSource(videoDataSource,new AdaptiveEvaluator(bandwidthMeter),videoRepresentations);
  }
 else   if (mimeType.equals(MimeTypes.VIDEO_WEBM)) {
    videoRepresentations=getSdRepresentations(videoRepresentations);
    videoChunkSource=new DashWebmChunkSource(videoDataSource,new AdaptiveEvaluator(bandwidthMeter),videoRepresentations);
  }
 else {
    throw new IllegalStateException("String_Node_Str" + mimeType);
  }
  ChunkSampleSource videoSampleSource=new ChunkSampleSource(videoChunkSource,loadControl,VIDEO_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE,true,mainHandler,player,ExoplayerWrapper.TYPE_VIDEO);
  MediaCodecVideoTrackRenderer videoRenderer=new MediaCodecVideoTrackRenderer(videoSampleSource,drmSessionManager,true,MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT,ALLOWED_JOINING_TIME_MS,mainHandler,player,MAX_DROPPED_FRAME_COUNT_TO_NOTIFY);
  final String[] audioTrackNames;
  final MultiTrackChunkSource audioChunkSource;
  final MediaCodecAudioTrackRenderer audioRenderer;
  if (audioRepresentationsList.isEmpty()) {
    audioTrackNames=null;
    audioChunkSource=null;
    audioRenderer=null;
  }
 else {
    DataSource audioDataSource=new HttpDataSource(userAgent,HttpDataSource.REJECT_PAYWALL_TYPES,bandwidthMeter);
    audioTrackNames=new String[audioRepresentationsList.size()];
    ChunkSource[] audioChunkSources=new ChunkSource[audioRepresentationsList.size()];
    FormatEvaluator audioEvaluator=new FormatEvaluator.FixedEvaluator();
    for (int i=0; i < audioRepresentationsList.size(); i++) {
      Representation representation=audioRepresentationsList.get(i);
      Format format=representation.format;
      audioTrackNames[i]=format.id + "String_Node_Str" + format.numChannels+ "String_Node_Str"+ format.audioSamplingRate+ "String_Node_Str";
      audioChunkSources[i]=new DashMp4ChunkSource(audioDataSource,audioEvaluator,representation);
    }
    audioChunkSource=new MultiTrackChunkSource(audioChunkSources);
    SampleSource audioSampleSource=new ChunkSampleSource(audioChunkSource,loadControl,AUDIO_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE,true,mainHandler,player,ExoplayerWrapper.TYPE_AUDIO);
    audioRenderer=new MediaCodecAudioTrackRenderer(audioSampleSource,drmSessionManager,true,mainHandler,player);
  }
  String[][] trackNames=new String[ExoplayerWrapper.RENDERER_COUNT][];
  trackNames[ExoplayerWrapper.TYPE_AUDIO]=audioTrackNames;
  MultiTrackChunkSource[] multiTrackChunkSources=new MultiTrackChunkSource[ExoplayerWrapper.RENDERER_COUNT];
  multiTrackChunkSources[ExoplayerWrapper.TYPE_AUDIO]=audioChunkSource;
  TrackRenderer[] renderers=new TrackRenderer[ExoplayerWrapper.RENDERER_COUNT];
  renderers[ExoplayerWrapper.TYPE_VIDEO]=videoRenderer;
  renderers[ExoplayerWrapper.TYPE_AUDIO]=audioRenderer;
  callback.onRenderersBuilt(trackNames,multiTrackChunkSources,renderers);
}

Fixed version (ground truth):
@Override public void onManifest(String contentId,MediaPresentationDescription manifest){
  Handler mainHandler=player.getMainHandler();
  LoadControl loadControl=new DefaultLoadControl(new BufferPool(BUFFER_SEGMENT_SIZE));
  DefaultBandwidthMeter bandwidthMeter=new DefaultBandwidthMeter(mainHandler,player);
  int maxDecodableFrameSize=MediaCodecUtil.maxH264DecodableFrameSize();
  ArrayList<Representation> audioRepresentationsList=new ArrayList<Representation>();
  ArrayList<Representation> videoRepresentationsList=new ArrayList<Representation>();
  Period period=manifest.periods.get(0);
  boolean hasContentProtection=false;
  for (int i=0; i < period.adaptationSets.size(); i++) {
    AdaptationSet adaptationSet=period.adaptationSets.get(i);
    hasContentProtection|=adaptationSet.hasContentProtection();
    int adaptationSetType=adaptationSet.type;
    for (int j=0; j < adaptationSet.representations.size(); j++) {
      Representation representation=adaptationSet.representations.get(j);
      if (adaptationSetType == AdaptationSet.TYPE_AUDIO) {
        audioRepresentationsList.add(representation);
      }
 else       if (adaptationSetType == AdaptationSet.TYPE_VIDEO) {
        Format format=representation.format;
        if (format.width * format.height <= maxDecodableFrameSize) {
          videoRepresentationsList.add(representation);
        }
 else {
        }
      }
    }
  }
  Representation[] videoRepresentations=new Representation[videoRepresentationsList.size()];
  videoRepresentationsList.toArray(videoRepresentations);
  DrmSessionManager drmSessionManager=null;
  if (hasContentProtection) {
    if (Util.SDK_INT < 18) {
      callback.onRenderersError(new UnsupportedOperationException("String_Node_Str" + Util.SDK_INT));
      return;
    }
    try {
      Pair<DrmSessionManager,Boolean> drmSessionManagerData=V18Compat.getDrmSessionManagerData(player,drmCallback);
      drmSessionManager=drmSessionManagerData.first;
      if (!drmSessionManagerData.second) {
        videoRepresentations=getSdRepresentations(videoRepresentations);
      }
    }
 catch (    Exception e) {
      callback.onRenderersError(e);
      return;
    }
  }
  DataSource videoDataSource=new HttpDataSource(userAgent,null,bandwidthMeter);
  ChunkSource videoChunkSource;
  String mimeType=videoRepresentations[0].format.mimeType;
  if (mimeType.equals(MimeTypes.VIDEO_MP4)) {
    videoChunkSource=new DashMp4ChunkSource(videoDataSource,new AdaptiveEvaluator(bandwidthMeter),videoRepresentations);
  }
 else   if (mimeType.equals(MimeTypes.VIDEO_WEBM)) {
    videoRepresentations=getSdRepresentations(videoRepresentations);
    videoChunkSource=new DashWebmChunkSource(videoDataSource,new AdaptiveEvaluator(bandwidthMeter),videoRepresentations);
  }
 else {
    throw new IllegalStateException("String_Node_Str" + mimeType);
  }
  ChunkSampleSource videoSampleSource=new ChunkSampleSource(videoChunkSource,loadControl,VIDEO_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE,true,mainHandler,player,ExoplayerWrapper.TYPE_VIDEO);
  MediaCodecVideoTrackRenderer videoRenderer=new MediaCodecVideoTrackRenderer(videoSampleSource,drmSessionManager,true,MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT,ALLOWED_JOINING_TIME_MS,mainHandler,player,MAX_DROPPED_FRAME_COUNT_TO_NOTIFY);
  final String[] audioTrackNames;
  final MultiTrackChunkSource audioChunkSource;
  final MediaCodecAudioTrackRenderer audioRenderer;
  if (audioRepresentationsList.isEmpty()) {
    audioTrackNames=null;
    audioChunkSource=null;
    audioRenderer=null;
  }
 else {
    DataSource audioDataSource=new HttpDataSource(userAgent,HttpDataSource.REJECT_PAYWALL_TYPES,bandwidthMeter);
    audioTrackNames=new String[audioRepresentationsList.size()];
    ChunkSource[] audioChunkSources=new ChunkSource[audioRepresentationsList.size()];
    FormatEvaluator audioEvaluator=new FormatEvaluator.FixedEvaluator();
    for (int i=0; i < audioRepresentationsList.size(); i++) {
      Representation representation=audioRepresentationsList.get(i);
      Format format=representation.format;
      audioTrackNames[i]=format.id + "String_Node_Str" + format.numChannels+ "String_Node_Str"+ format.audioSamplingRate+ "String_Node_Str";
      audioChunkSources[i]=new DashMp4ChunkSource(audioDataSource,audioEvaluator,representation);
    }
    audioChunkSource=new MultiTrackChunkSource(audioChunkSources);
    SampleSource audioSampleSource=new ChunkSampleSource(audioChunkSource,loadControl,AUDIO_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE,true,mainHandler,player,ExoplayerWrapper.TYPE_AUDIO);
    audioRenderer=new MediaCodecAudioTrackRenderer(audioSampleSource,drmSessionManager,true,mainHandler,player);
  }
  String[][] trackNames=new String[ExoplayerWrapper.RENDERER_COUNT][];
  trackNames[ExoplayerWrapper.TYPE_AUDIO]=audioTrackNames;
  MultiTrackChunkSource[] multiTrackChunkSources=new MultiTrackChunkSource[ExoplayerWrapper.RENDERER_COUNT];
  multiTrackChunkSources[ExoplayerWrapper.TYPE_AUDIO]=audioChunkSource;
  TrackRenderer[] renderers=new TrackRenderer[ExoplayerWrapper.RENDERER_COUNT];
  renderers[ExoplayerWrapper.TYPE_VIDEO]=videoRenderer;
  renderers[ExoplayerWrapper.TYPE_AUDIO]=audioRenderer;
  callback.onRenderersBuilt(trackNames,multiTrackChunkSources,renderers);
}