Program: 30910
Project: 30910
Buggy source:
private Representation readRepresentation(MPD mpd,Period period,AdaptationSet adaptationSet,Uri baseUrl,XmlPullParser parser,SegmentTemplate segmentTemplate) throws XmlPullParserException, IOException, DashParserException {
  Representation representation=new Representation();
  representation.id=getAttributeValue(parser,"String_Node_Str");
  representation.codec=getAttributeValue(parser,"String_Node_Str");
  representation.mimeType=getAttributeValue(parser,"String_Node_Str",adaptationSet.mimeType);
  if (representation.mimeType.startsWith("String_Node_Str")) {
    representation.width=getAttributeValueInt(parser,"String_Node_Str");
    representation.height=getAttributeValueInt(parser,"String_Node_Str");
    representation.sar=getAttributeValueRatio(parser,"String_Node_Str");
  }
  representation.bandwidth=getAttributeValueInt(parser,"String_Node_Str");
  int type=0;
  while ((type=parser.next()) >= 0) {
    String tagName=parser.getName();
    if (type == XmlPullParser.START_TAG) {
      if (tagName.equals("String_Node_Str")) {
        String sourceURL=getAttributeValue(parser,"String_Node_Str");
        String range=getAttributeValue(parser,"String_Node_Str");
        sourceURL=sourceURL != null ? extendUrl(baseUrl,sourceURL).toString() : baseUrl.toString();
        representation.initSegment=new Segment(sourceURL,range);
        Log.d(TAG,"String_Node_Str" + representation.initSegment.toString());
      }
 else       if (tagName.equals("String_Node_Str")) {
        long timescale=getAttributeValueLong(parser,"String_Node_Str",1);
        long duration=getAttributeValueLong(parser,"String_Node_Str");
        representation.segmentDurationUs=(long)(((double)duration / timescale) * 1000000d);
      }
 else       if (tagName.equals("String_Node_Str")) {
        String media=getAttributeValue(parser,"String_Node_Str");
        String mediaRange=getAttributeValue(parser,"String_Node_Str");
        String indexRange=getAttributeValue(parser,"String_Node_Str");
        media=media != null ? extendUrl(baseUrl,media).toString() : baseUrl.toString();
        representation.segments.add(new Segment(media,mediaRange));
        if (indexRange != null) {
          Log.v(TAG,"String_Node_Str");
        }
      }
 else       if (tagName.equals("String_Node_Str")) {
        String indexRange=getAttributeValue(parser,"String_Node_Str");
        if (indexRange != null) {
          throw new DashParserException("String_Node_Str");
        }
      }
 else       if (tagName.equals("String_Node_Str")) {
        segmentTemplate=readSegmentTemplate(parser,baseUrl,segmentTemplate);
      }
 else       if (tagName.equals("String_Node_Str")) {
        baseUrl=extendUrl(baseUrl,parser.nextText());
        Log.d(TAG,"String_Node_Str" + baseUrl);
      }
 else       if (tagName.equals("String_Node_Str")) {
        throw new DashParserException("String_Node_Str");
      }
    }
 else     if (type == XmlPullParser.END_TAG) {
      if (tagName.equals("String_Node_Str")) {
        if (!representation.segments.isEmpty()) {
        }
 else         if (segmentTemplate != null) {
          if (segmentTemplate.hasTimeline()) {
            if (segmentTemplate.timeline.size() > 1) {
              throw new DashParserException("String_Node_Str");
            }
            SegmentTemplate.SegmentTimelineEntry current, previous, next;
            for (int i=0; i < segmentTemplate.timeline.size(); i++) {
              current=segmentTemplate.timeline.get(i);
              next=i < segmentTemplate.timeline.size() - 1 ? segmentTemplate.timeline.get(i + 1) : null;
              int repeat=current.r;
              if (repeat < 0) {
                long duration=next != null ? next.t - current.t : calculateTimescaleTime(mpd.mediaPresentationDurationUs,segmentTemplate.timescale) - current.t;
                repeat=(int)(duration / current.d) - 1;
              }
              representation.segmentDurationUs=calculateUs(current.d,segmentTemplate.timescale);
              String processedInitUrl=processMediaUrl(segmentTemplate.init,representation.id,null,representation.bandwidth,null);
              representation.initSegment=new Segment(processedInitUrl);
              long time=current.t;
              for (int number=segmentTemplate.startNumber; number < repeat + 1; number++) {
                String processedMediaUrl=processMediaUrl(segmentTemplate.media,representation.id,number,representation.bandwidth,time);
                representation.segments.add(new Segment(processedMediaUrl));
                time+=current.d;
              }
            }
          }
 else {
            representation.segmentDurationUs=segmentTemplate.calculateDurationUs();
            int numSegments=(int)Math.ceil((double)mpd.mediaPresentationDurationUs / representation.segmentDurationUs);
            if (mpd.isDynamic) {
              Date now=new Date();
              Calendar calendar=Calendar.getInstance();
              calendar.setTime(now);
              calendar.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
              now=calendar.getTime();
              long availabilityDeltaTimeUs=(now.getTime() - mpd.availabilityStartTime.getTime()) * 1000;
              availabilityDeltaTimeUs-=period.startUs;
              availabilityDeltaTimeUs-=segmentTemplate.presentationTimeOffsetUs;
              availabilityDeltaTimeUs-=Math.max(mpd.minBufferTimeUs,10 * 1000000L);
              availabilityDeltaTimeUs-=mpd.suggestedPresentationDelayUs;
              segmentTemplate.startNumber+=(int)(availabilityDeltaTimeUs / representation.segmentDurationUs);
            }
            String processedInitUrl=processMediaUrl(segmentTemplate.init,representation.id,null,representation.bandwidth,null);
            representation.initSegment=new Segment(processedInitUrl);
            for (int i=segmentTemplate.startNumber; i < segmentTemplate.startNumber + numSegments; i++) {
              String processedMediaUrl=processMediaUrl(segmentTemplate.media,representation.id,i,representation.bandwidth,null);
              representation.segments.add(new Segment(processedMediaUrl));
            }
          }
        }
 else {
          if (representation.mimeType != null && representation.mimeType.startsWith("String_Node_Str")) {
            Log.i(TAG,"String_Node_Str");
          }
 else {
            throw new DashParserException("String_Node_Str");
          }
        }
        Log.d(TAG,representation.toString());
        return representation;
      }
    }
  }
  throw new DashParserException("String_Node_Str");
}

Fixed version (ground truth):
private Representation readRepresentation(MPD mpd,Period period,AdaptationSet adaptationSet,Uri baseUrl,XmlPullParser parser,SegmentTemplate segmentTemplate) throws XmlPullParserException, IOException, DashParserException {
  Representation representation=new Representation();
  representation.id=getAttributeValue(parser,"String_Node_Str");
  representation.codec=getAttributeValue(parser,"String_Node_Str");
  representation.mimeType=getAttributeValue(parser,"String_Node_Str",adaptationSet.mimeType);
  if (representation.mimeType.startsWith("String_Node_Str")) {
    representation.width=getAttributeValueInt(parser,"String_Node_Str");
    representation.height=getAttributeValueInt(parser,"String_Node_Str");
    representation.sar=getAttributeValueRatio(parser,"String_Node_Str");
  }
  representation.bandwidth=getAttributeValueInt(parser,"String_Node_Str");
  int type=0;
  while ((type=parser.next()) >= 0) {
    String tagName=parser.getName();
    if (type == XmlPullParser.START_TAG) {
      if (tagName.equals("String_Node_Str")) {
        String sourceURL=getAttributeValue(parser,"String_Node_Str");
        String range=getAttributeValue(parser,"String_Node_Str");
        sourceURL=sourceURL != null ? extendUrl(baseUrl,sourceURL).toString() : baseUrl.toString();
        representation.initSegment=new Segment(sourceURL,range);
        Log.d(TAG,"String_Node_Str" + representation.initSegment.toString());
      }
 else       if (tagName.equals("String_Node_Str")) {
        long timescale=getAttributeValueLong(parser,"String_Node_Str",1);
        long duration=getAttributeValueLong(parser,"String_Node_Str");
        representation.segmentDurationUs=(long)(((double)duration / timescale) * 1000000d);
      }
 else       if (tagName.equals("String_Node_Str")) {
        String media=getAttributeValue(parser,"String_Node_Str");
        String mediaRange=getAttributeValue(parser,"String_Node_Str");
        String indexRange=getAttributeValue(parser,"String_Node_Str");
        media=media != null ? extendUrl(baseUrl,media).toString() : baseUrl.toString();
        representation.segments.add(new Segment(media,mediaRange));
        if (indexRange != null) {
          Log.v(TAG,"String_Node_Str");
        }
      }
 else       if (tagName.equals("String_Node_Str")) {
        String indexRange=getAttributeValue(parser,"String_Node_Str");
        if (indexRange != null) {
          throw new DashParserException("String_Node_Str");
        }
      }
 else       if (tagName.equals("String_Node_Str")) {
        segmentTemplate=readSegmentTemplate(parser,baseUrl,segmentTemplate);
      }
 else       if (tagName.equals("String_Node_Str")) {
        baseUrl=extendUrl(baseUrl,parser.nextText());
        Log.d(TAG,"String_Node_Str" + baseUrl);
      }
 else       if (tagName.equals("String_Node_Str")) {
        throw new DashParserException("String_Node_Str");
      }
    }
 else     if (type == XmlPullParser.END_TAG) {
      if (tagName.equals("String_Node_Str")) {
        if (!representation.segments.isEmpty()) {
        }
 else         if (segmentTemplate != null) {
          if (segmentTemplate.hasTimeline()) {
            if (segmentTemplate.timeline.size() > 1) {
              throw new DashParserException("String_Node_Str");
            }
            SegmentTemplate.SegmentTimelineEntry current, previous, next;
            for (int i=0; i < segmentTemplate.timeline.size(); i++) {
              current=segmentTemplate.timeline.get(i);
              next=i < segmentTemplate.timeline.size() - 1 ? segmentTemplate.timeline.get(i + 1) : null;
              int repeat=current.r;
              if (repeat < 0) {
                long duration=next != null ? next.t - current.t : calculateTimescaleTime(mpd.mediaPresentationDurationUs,segmentTemplate.timescale) - current.t;
                repeat=(int)(duration / current.d) - 1;
              }
              representation.segmentDurationUs=calculateUs(current.d,segmentTemplate.timescale);
              String processedInitUrl=processMediaUrl(segmentTemplate.init,representation.id,null,representation.bandwidth,null);
              representation.initSegment=new Segment(processedInitUrl);
              long time=current.t;
              for (int number=segmentTemplate.startNumber; number < repeat + 1; number++) {
                String processedMediaUrl=processMediaUrl(segmentTemplate.media,representation.id,number,representation.bandwidth,time);
                representation.segments.add(new Segment(processedMediaUrl));
                time+=current.d;
              }
            }
          }
 else {
            representation.segmentDurationUs=segmentTemplate.calculateDurationUs();
            int numSegments=(int)Math.ceil((double)mpd.mediaPresentationDurationUs / representation.segmentDurationUs);
            int dynamicStartNumberOffset=0;
            if (mpd.isDynamic) {
              Date now=new Date();
              Calendar calendar=Calendar.getInstance();
              calendar.setTime(now);
              calendar.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
              now=calendar.getTime();
              long availabilityDeltaTimeUs=(now.getTime() - mpd.availabilityStartTime.getTime()) * 1000;
              availabilityDeltaTimeUs-=period.startUs;
              availabilityDeltaTimeUs-=segmentTemplate.presentationTimeOffsetUs;
              availabilityDeltaTimeUs-=Math.max(mpd.minBufferTimeUs,10 * 1000000L);
              availabilityDeltaTimeUs-=mpd.suggestedPresentationDelayUs;
              dynamicStartNumberOffset=(int)(availabilityDeltaTimeUs / representation.segmentDurationUs);
            }
            String processedInitUrl=processMediaUrl(segmentTemplate.init,representation.id,null,representation.bandwidth,null);
            representation.initSegment=new Segment(processedInitUrl);
            for (int i=segmentTemplate.startNumber + dynamicStartNumberOffset; i < segmentTemplate.startNumber + dynamicStartNumberOffset + numSegments; i++) {
              String processedMediaUrl=processMediaUrl(segmentTemplate.media,representation.id,i,representation.bandwidth,null);
              representation.segments.add(new Segment(processedMediaUrl));
            }
          }
        }
 else {
          if (representation.mimeType != null && representation.mimeType.startsWith("String_Node_Str")) {
            Log.i(TAG,"String_Node_Str");
          }
 else {
            throw new DashParserException("String_Node_Str");
          }
        }
        Log.d(TAG,representation.toString());
        return representation;
      }
    }
  }
  throw new DashParserException("String_Node_Str");
}