Program: 110482
Project: 110482
Buggy source:
@Override public void onManifest(String contentId,SmoothStreamingManifest manifest){
  Handler mainHandler=player.getMainHandler();
  LoadControl loadControl=new DefaultLoadControl(new BufferPool(BUFFER_SEGMENT_SIZE));
  DefaultBandwidthMeter bandwidthMeter=new DefaultBandwidthMeter(mainHandler,player);
  DrmSessionManager drmSessionManager=null;
  if (manifest.protectionElement != null) {
    if (Util.SDK_INT < 18) {
      callback.onRenderersError(new UnsupportedOperationException("String_Node_Str" + Util.SDK_INT));
      return;
    }
    try {
      drmSessionManager=V18Compat.getDrmSessionManager(manifest.protectionElement.uuid,player,drmCallback);
    }
 catch (    UnsupportedSchemeException e) {
      callback.onRenderersError(e);
      return;
    }
  }
  int maxDecodableFrameSize=MediaCodecUtil.maxH264DecodableFrameSize();
  int audioStreamElementCount=0;
  int textStreamElementCount=0;
  int videoStreamElementIndex=-1;
  ArrayList<Integer> videoTrackIndexList=new ArrayList<Integer>();
  for (int i=0; i < manifest.streamElements.length; i++) {
    if (manifest.streamElements[i].type == StreamElement.TYPE_AUDIO) {
      audioStreamElementCount++;
    }
 else     if (manifest.streamElements[i].type == StreamElement.TYPE_TEXT) {
      textStreamElementCount++;
    }
 else     if (videoStreamElementIndex == -1 && manifest.streamElements[i].type == StreamElement.TYPE_VIDEO) {
      videoStreamElementIndex=i;
      StreamElement streamElement=manifest.streamElements[i];
      for (int j=0; j < streamElement.tracks.length; j++) {
        TrackElement trackElement=streamElement.tracks[j];
        if (trackElement.maxWidth * trackElement.maxHeight <= maxDecodableFrameSize) {
          videoTrackIndexList.add(j);
        }
 else {
        }
      }
    }
  }
  int[] videoTrackIndices=new int[videoTrackIndexList.size()];
  for (int i=0; i < videoTrackIndexList.size(); i++) {
    videoTrackIndices[i]=videoTrackIndexList.get(i);
  }
  DataSource videoDataSource=new HttpDataSource(userAgent,HttpDataSource.REJECT_PAYWALL_TYPES,bandwidthMeter);
  ChunkSource videoChunkSource=new SmoothStreamingChunkSource(url,manifest,videoStreamElementIndex,videoTrackIndices,videoDataSource,new AdaptiveEvaluator(bandwidthMeter));
  ChunkSampleSource videoSampleSource=new ChunkSampleSource(videoChunkSource,loadControl,VIDEO_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE,true,mainHandler,player,DemoPlayer.TYPE_VIDEO);
  MediaCodecVideoTrackRenderer videoRenderer=new MediaCodecVideoTrackRenderer(videoSampleSource,drmSessionManager,true,MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT,5000,mainHandler,player,50);
  final String[] audioTrackNames;
  final MultiTrackChunkSource audioChunkSource;
  final MediaCodecAudioTrackRenderer audioRenderer;
  if (audioStreamElementCount == 0) {
    audioTrackNames=null;
    audioChunkSource=null;
    audioRenderer=null;
  }
 else {
    audioTrackNames=new String[audioStreamElementCount];
    ChunkSource[] audioChunkSources=new ChunkSource[audioStreamElementCount];
    DataSource audioDataSource=new HttpDataSource(userAgent,HttpDataSource.REJECT_PAYWALL_TYPES,bandwidthMeter);
    FormatEvaluator audioFormatEvaluator=new FormatEvaluator.FixedEvaluator();
    audioStreamElementCount=0;
    for (int i=0; i < manifest.streamElements.length; i++) {
      if (manifest.streamElements[i].type == StreamElement.TYPE_AUDIO) {
        audioTrackNames[audioStreamElementCount]=manifest.streamElements[i].name;
        audioChunkSources[audioStreamElementCount]=new SmoothStreamingChunkSource(url,manifest,i,new int[]{0},audioDataSource,audioFormatEvaluator);
        audioStreamElementCount++;
      }
    }
    audioChunkSource=new MultiTrackChunkSource(audioChunkSources);
    ChunkSampleSource audioSampleSource=new ChunkSampleSource(audioChunkSource,loadControl,AUDIO_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE,true,mainHandler,player,DemoPlayer.TYPE_AUDIO);
    audioRenderer=new MediaCodecAudioTrackRenderer(audioSampleSource,drmSessionManager,true,mainHandler,player);
  }
  final String[] textTrackNames;
  final MultiTrackChunkSource textChunkSource;
  final TrackRenderer textRenderer;
  if (textStreamElementCount == 0) {
    textTrackNames=null;
    textChunkSource=null;
    textRenderer=null;
  }
 else {
    textTrackNames=new String[textStreamElementCount];
    ChunkSource[] textChunkSources=new ChunkSource[textStreamElementCount];
    DataSource ttmlDataSource=new HttpDataSource(userAgent,HttpDataSource.REJECT_PAYWALL_TYPES,bandwidthMeter);
    FormatEvaluator ttmlFormatEvaluator=new FormatEvaluator.FixedEvaluator();
    textStreamElementCount=0;
    for (int i=0; i < manifest.streamElements.length; i++) {
      if (manifest.streamElements[i].type == StreamElement.TYPE_TEXT) {
        textTrackNames[textStreamElementCount]=manifest.streamElements[i].language;
        textChunkSources[textStreamElementCount]=new SmoothStreamingChunkSource(url,manifest,i,new int[]{0},ttmlDataSource,ttmlFormatEvaluator);
        textStreamElementCount++;
      }
    }
    textChunkSource=new MultiTrackChunkSource(textChunkSources);
    ChunkSampleSource ttmlSampleSource=new ChunkSampleSource(textChunkSource,loadControl,TTML_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE,true,mainHandler,player,DemoPlayer.TYPE_TEXT);
    textRenderer=new TextTrackRenderer(ttmlSampleSource,new TtmlParser(),player,mainHandler.getLooper());
  }
  TrackRenderer debugRenderer=debugTextView != null ? new DebugTrackRenderer(debugTextView,videoRenderer,videoSampleSource) : null;
  String[][] trackNames=new String[DemoPlayer.RENDERER_COUNT][];
  trackNames[DemoPlayer.TYPE_AUDIO]=audioTrackNames;
  trackNames[DemoPlayer.TYPE_TEXT]=textTrackNames;
  MultiTrackChunkSource[] multiTrackChunkSources=new MultiTrackChunkSource[DemoPlayer.RENDERER_COUNT];
  multiTrackChunkSources[DemoPlayer.TYPE_AUDIO]=audioChunkSource;
  multiTrackChunkSources[DemoPlayer.TYPE_TEXT]=textChunkSource;
  TrackRenderer[] renderers=new TrackRenderer[DemoPlayer.RENDERER_COUNT];
  renderers[DemoPlayer.TYPE_VIDEO]=videoRenderer;
  renderers[DemoPlayer.TYPE_AUDIO]=audioRenderer;
  renderers[DemoPlayer.TYPE_TEXT]=textRenderer;
  renderers[DemoPlayer.TYPE_DEBUG]=debugRenderer;
  callback.onRenderers(trackNames,multiTrackChunkSources,renderers);
}

Fixed version (ground truth):
@Override public void onManifest(String contentId,SmoothStreamingManifest manifest){
  Handler mainHandler=player.getMainHandler();
  LoadControl loadControl=new DefaultLoadControl(new BufferPool(BUFFER_SEGMENT_SIZE));
  DefaultBandwidthMeter bandwidthMeter=new DefaultBandwidthMeter(mainHandler,player);
  DrmSessionManager drmSessionManager=null;
  if (manifest.protectionElement != null) {
    if (Util.SDK_INT < 18) {
      callback.onRenderersError(new UnsupportedOperationException("String_Node_Str" + Util.SDK_INT));
      return;
    }
    try {
      drmSessionManager=V18Compat.getDrmSessionManager(manifest.protectionElement.uuid,player,drmCallback);
    }
 catch (    Exception e) {
      callback.onRenderersError(e);
      return;
    }
  }
  int maxDecodableFrameSize=MediaCodecUtil.maxH264DecodableFrameSize();
  int audioStreamElementCount=0;
  int textStreamElementCount=0;
  int videoStreamElementIndex=-1;
  ArrayList<Integer> videoTrackIndexList=new ArrayList<Integer>();
  for (int i=0; i < manifest.streamElements.length; i++) {
    if (manifest.streamElements[i].type == StreamElement.TYPE_AUDIO) {
      audioStreamElementCount++;
    }
 else     if (manifest.streamElements[i].type == StreamElement.TYPE_TEXT) {
      textStreamElementCount++;
    }
 else     if (videoStreamElementIndex == -1 && manifest.streamElements[i].type == StreamElement.TYPE_VIDEO) {
      videoStreamElementIndex=i;
      StreamElement streamElement=manifest.streamElements[i];
      for (int j=0; j < streamElement.tracks.length; j++) {
        TrackElement trackElement=streamElement.tracks[j];
        if (trackElement.maxWidth * trackElement.maxHeight <= maxDecodableFrameSize) {
          videoTrackIndexList.add(j);
        }
 else {
        }
      }
    }
  }
  int[] videoTrackIndices=new int[videoTrackIndexList.size()];
  for (int i=0; i < videoTrackIndexList.size(); i++) {
    videoTrackIndices[i]=videoTrackIndexList.get(i);
  }
  DataSource videoDataSource=new HttpDataSource(userAgent,HttpDataSource.REJECT_PAYWALL_TYPES,bandwidthMeter);
  ChunkSource videoChunkSource=new SmoothStreamingChunkSource(url,manifest,videoStreamElementIndex,videoTrackIndices,videoDataSource,new AdaptiveEvaluator(bandwidthMeter));
  ChunkSampleSource videoSampleSource=new ChunkSampleSource(videoChunkSource,loadControl,VIDEO_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE,true,mainHandler,player,DemoPlayer.TYPE_VIDEO);
  MediaCodecVideoTrackRenderer videoRenderer=new MediaCodecVideoTrackRenderer(videoSampleSource,drmSessionManager,true,MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT,5000,mainHandler,player,50);
  final String[] audioTrackNames;
  final MultiTrackChunkSource audioChunkSource;
  final MediaCodecAudioTrackRenderer audioRenderer;
  if (audioStreamElementCount == 0) {
    audioTrackNames=null;
    audioChunkSource=null;
    audioRenderer=null;
  }
 else {
    audioTrackNames=new String[audioStreamElementCount];
    ChunkSource[] audioChunkSources=new ChunkSource[audioStreamElementCount];
    DataSource audioDataSource=new HttpDataSource(userAgent,HttpDataSource.REJECT_PAYWALL_TYPES,bandwidthMeter);
    FormatEvaluator audioFormatEvaluator=new FormatEvaluator.FixedEvaluator();
    audioStreamElementCount=0;
    for (int i=0; i < manifest.streamElements.length; i++) {
      if (manifest.streamElements[i].type == StreamElement.TYPE_AUDIO) {
        audioTrackNames[audioStreamElementCount]=manifest.streamElements[i].name;
        audioChunkSources[audioStreamElementCount]=new SmoothStreamingChunkSource(url,manifest,i,new int[]{0},audioDataSource,audioFormatEvaluator);
        audioStreamElementCount++;
      }
    }
    audioChunkSource=new MultiTrackChunkSource(audioChunkSources);
    ChunkSampleSource audioSampleSource=new ChunkSampleSource(audioChunkSource,loadControl,AUDIO_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE,true,mainHandler,player,DemoPlayer.TYPE_AUDIO);
    audioRenderer=new MediaCodecAudioTrackRenderer(audioSampleSource,drmSessionManager,true,mainHandler,player);
  }
  final String[] textTrackNames;
  final MultiTrackChunkSource textChunkSource;
  final TrackRenderer textRenderer;
  if (textStreamElementCount == 0) {
    textTrackNames=null;
    textChunkSource=null;
    textRenderer=null;
  }
 else {
    textTrackNames=new String[textStreamElementCount];
    ChunkSource[] textChunkSources=new ChunkSource[textStreamElementCount];
    DataSource ttmlDataSource=new HttpDataSource(userAgent,HttpDataSource.REJECT_PAYWALL_TYPES,bandwidthMeter);
    FormatEvaluator ttmlFormatEvaluator=new FormatEvaluator.FixedEvaluator();
    textStreamElementCount=0;
    for (int i=0; i < manifest.streamElements.length; i++) {
      if (manifest.streamElements[i].type == StreamElement.TYPE_TEXT) {
        textTrackNames[textStreamElementCount]=manifest.streamElements[i].language;
        textChunkSources[textStreamElementCount]=new SmoothStreamingChunkSource(url,manifest,i,new int[]{0},ttmlDataSource,ttmlFormatEvaluator);
        textStreamElementCount++;
      }
    }
    textChunkSource=new MultiTrackChunkSource(textChunkSources);
    ChunkSampleSource ttmlSampleSource=new ChunkSampleSource(textChunkSource,loadControl,TTML_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE,true,mainHandler,player,DemoPlayer.TYPE_TEXT);
    textRenderer=new TextTrackRenderer(ttmlSampleSource,new TtmlParser(),player,mainHandler.getLooper());
  }
  TrackRenderer debugRenderer=debugTextView != null ? new DebugTrackRenderer(debugTextView,videoRenderer,videoSampleSource) : null;
  String[][] trackNames=new String[DemoPlayer.RENDERER_COUNT][];
  trackNames[DemoPlayer.TYPE_AUDIO]=audioTrackNames;
  trackNames[DemoPlayer.TYPE_TEXT]=textTrackNames;
  MultiTrackChunkSource[] multiTrackChunkSources=new MultiTrackChunkSource[DemoPlayer.RENDERER_COUNT];
  multiTrackChunkSources[DemoPlayer.TYPE_AUDIO]=audioChunkSource;
  multiTrackChunkSources[DemoPlayer.TYPE_TEXT]=textChunkSource;
  TrackRenderer[] renderers=new TrackRenderer[DemoPlayer.RENDERER_COUNT];
  renderers[DemoPlayer.TYPE_VIDEO]=videoRenderer;
  renderers[DemoPlayer.TYPE_AUDIO]=audioRenderer;
  renderers[DemoPlayer.TYPE_TEXT]=textRenderer;
  renderers[DemoPlayer.TYPE_DEBUG]=debugRenderer;
  callback.onRenderers(trackNames,multiTrackChunkSources,renderers);
}