nus-yam/ex-repair huggingface dataset:
Program: 35726
Project: 35726
Buggy source:
private synchronized boolean audioEncodeStep(boolean isEnd){
  if (isStarted) {
    Log.d(Aavt.debugTag,"String_Node_Str");
    int inputIndex=mAudioEncoder.dequeueInputBuffer(TIME_OUT);
    if (inputIndex >= 0) {
      ByteBuffer buffer=CodecUtil.getInputBuffer(mAudioEncoder,inputIndex);
      buffer.clear();
      long time=(SystemClock.elapsedRealtimeNanos() - startTime) / 1000;
      int length=mRecord.read(buffer,mRecordBufferSize);
      if (length >= 0) {
        mAudioEncoder.queueInputBuffer(inputIndex,0,length,time,isEnd ? MediaCodec.BUFFER_FLAG_END_OF_STREAM : 0);
      }
    }
    MediaCodec.BufferInfo info=new MediaCodec.BufferInfo();
    while (true) {
      int outputIndex=mAudioEncoder.dequeueOutputBuffer(info,TIME_OUT);
      if (outputIndex >= 0) {
        if (mStore != null) {
          mStore.addData(mAudioTrack,CodecUtil.getOutputBuffer(mAudioEncoder,outputIndex),info);
        }
        mAudioEncoder.releaseOutputBuffer(outputIndex,false);
        if (info.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
          Log.d(Aavt.debugTag,"String_Node_Str");
          stop();
          return true;
        }
      }
 else       if (outputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
        break;
      }
 else       if (outputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
        Log.e(Aavt.debugTag,"String_Node_Str" + mAudioEncoder.getOutputFormat().toString());
        mAudioTrack=mStore.addFormat(mAudioEncoder.getOutputFormat());
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private synchronized boolean audioEncodeStep(boolean isEnd){
  if (isStarted) {
    Log.d(Aavt.debugTag,"String_Node_Str");
    int inputIndex=mAudioEncoder.dequeueInputBuffer(TIME_OUT);
    if (inputIndex >= 0) {
      ByteBuffer buffer=CodecUtil.getInputBuffer(mAudioEncoder,inputIndex);
      buffer.clear();
      long time=(SystemClock.elapsedRealtimeNanos() - startTime) / 1000;
      int length=mRecord.read(buffer,mRecordBufferSize);
      if (length >= 0) {
        mAudioEncoder.queueInputBuffer(inputIndex,0,length,time,isEnd ? MediaCodec.BUFFER_FLAG_END_OF_STREAM : 0);
      }
    }
    MediaCodec.BufferInfo info=new MediaCodec.BufferInfo();
    while (true) {
      int outputIndex=mAudioEncoder.dequeueOutputBuffer(info,TIME_OUT);
      if (outputIndex >= 0) {
        if (mStore != null) {
          mStore.addData(mAudioTrack,new HardMediaData(CodecUtil.getOutputBuffer(mAudioEncoder,outputIndex),info));
        }
        mAudioEncoder.releaseOutputBuffer(outputIndex,false);
        if (info.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
          Log.d(Aavt.debugTag,"String_Node_Str");
          stop();
          return true;
        }
      }
 else       if (outputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
        break;
      }
 else       if (outputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
        Log.e(Aavt.debugTag,"String_Node_Str" + mAudioEncoder.getOutputFormat().toString());
        mAudioTrack=mStore.addTrack(mAudioEncoder.getOutputFormat());
      }
    }
  }
  return false;
}
Program: 35727
Project: 35727
Buggy source:
public SoundRecorder(HardMediaStore store){
  this.mStore=store;
}

Fixed version (ground truth):
public SoundRecorder(IHardStore store){
  this.mStore=store;
}
Program: 35728
Project: 35728
Buggy source:
private boolean videoEncodeStep(boolean isEnd){
  if (isEnd) {
    mVideoEncoder.signalEndOfInputStream();
  }
  while (true) {
    int outputIndex=mVideoEncoder.dequeueOutputBuffer(mVideoEncodeBufferInfo,TIME_OUT);
    if (outputIndex >= 0) {
      if (isMuxStarted && mVideoEncodeBufferInfo.size > 0 && mVideoEncodeBufferInfo.presentationTimeUs > 0) {
        mMuxer.writeSampleData(mVideoTrack,getOutputBuffer(mVideoEncoder,outputIndex),mVideoEncodeBufferInfo);
      }
      mVideoEncoder.releaseOutputBuffer(outputIndex,false);
      if (mVideoEncodeBufferInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
        Log.d(Aavt.debugTag,"String_Node_Str");
        return true;
      }
    }
 else     if (outputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
      break;
    }
 else     if (outputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
      Log.e(Aavt.debugTag,"String_Node_Str" + mVideoEncoder.getOutputFormat().toString());
      mVideoTrack=mMuxer.addTrack(mVideoEncoder.getOutputFormat());
      mMuxer.start();
      isMuxStarted=true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean videoEncodeStep(boolean isEnd){
  if (isEnd) {
    mVideoEncoder.signalEndOfInputStream();
  }
  while (true) {
    int outputIndex=mVideoEncoder.dequeueOutputBuffer(mVideoEncodeBufferInfo,TIME_OUT);
    if (outputIndex >= 0) {
      if (isMuxStarted && mVideoEncodeBufferInfo.size > 0 && mVideoEncodeBufferInfo.presentationTimeUs > 0) {
        mMuxer.writeSampleData(mVideoTrack,getOutputBuffer(mVideoEncoder,outputIndex),mVideoEncodeBufferInfo);
      }
      mVideoEncoder.releaseOutputBuffer(outputIndex,false);
      if (mVideoEncodeBufferInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
        AvLog.d("String_Node_Str");
        return true;
      }
    }
 else     if (outputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
      break;
    }
 else     if (outputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
      AvLog.d("String_Node_Str" + mVideoEncoder.getOutputFormat().toString());
      mVideoTrack=mMuxer.addTrack(mVideoEncoder.getOutputFormat());
      mMuxer.start();
      isMuxStarted=true;
    }
  }
  return false;
}
Program: 35729
Project: 35729
Buggy source:
public void startPreview(){
synchronized (REC_LOCK) {
    Log.d(Aavt.debugTag,"String_Node_Str");
    mSem.drainPermits();
    mGLThreadFlag=true;
    mGLThread=new Thread(mGLRunnable);
    mGLThread.start();
  }
}

Fixed version (ground truth):
public void startPreview(){
synchronized (REC_LOCK) {
    AvLog.d("String_Node_Str");
    mSem.drainPermits();
    mGLThreadFlag=true;
    mGLThread=new Thread(mGLRunnable);
    mGLThread.start();
  }
}
Program: 35731
Project: 35731
Buggy source:
public void stopPreview() throws InterruptedException {
synchronized (REC_LOCK) {
    mGLThreadFlag=false;
    mSem.release();
    if (mGLThread != null && mGLThread.isAlive()) {
      mGLThread.join();
      mGLThread=null;
    }
    Log.d(Aavt.debugTag,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void stopPreview() throws InterruptedException {
synchronized (REC_LOCK) {
    mGLThreadFlag=false;
    mSem.release();
    if (mGLThread != null && mGLThread.isAlive()) {
      mGLThread.join();
      mGLThread=null;
    }
    AvLog.d("String_Node_Str");
  }
}
Program: 35733
Project: 35733
Buggy source:
public void stopRecord() throws InterruptedException {
synchronized (REC_LOCK) {
    if (isRecordStarted) {
      isTryStopAudio=true;
      if (isRecordAudioStarted) {
        mAudioThread.join();
        isRecordAudioStarted=false;
      }
synchronized (VIDEO_LOCK) {
        if (isRecordVideoStarted) {
          mEGLEncodeSurface=null;
          videoEncodeStep(true);
        }
        isRecordVideoStarted=false;
      }
      mAudioEncoder.stop();
      mAudioEncoder.release();
      mVideoEncoder.stop();
      mVideoEncoder.release();
      try {
        if (isMuxStarted) {
          isMuxStarted=false;
          mMuxer.stop();
          mMuxer.release();
        }
      }
 catch (      IllegalStateException e) {
        e.printStackTrace();
        File file=new File(mOutputPath);
        if (file.exists() && file.delete()) {
          Log.d(Aavt.debugTag,"String_Node_Str" + mOutputPath);
        }
      }
      mAudioEncoder=null;
      mVideoEncoder=null;
      mMuxer=null;
      mAudioTrack=-1;
      mVideoTrack=-1;
      isRecordStarted=false;
    }
  }
}

Fixed version (ground truth):
public void stopRecord() throws InterruptedException {
synchronized (REC_LOCK) {
    if (isRecordStarted) {
      isTryStopAudio=true;
      if (isRecordAudioStarted) {
        mAudioThread.join();
        isRecordAudioStarted=false;
      }
synchronized (VIDEO_LOCK) {
        if (isRecordVideoStarted) {
          mEGLEncodeSurface=null;
          videoEncodeStep(true);
        }
        isRecordVideoStarted=false;
      }
      mAudioEncoder.stop();
      mAudioEncoder.release();
      mVideoEncoder.stop();
      mVideoEncoder.release();
      try {
        if (isMuxStarted) {
          isMuxStarted=false;
          mMuxer.stop();
          mMuxer.release();
        }
      }
 catch (      IllegalStateException e) {
        e.printStackTrace();
        File file=new File(mOutputPath);
        if (file.exists() && file.delete()) {
          AvLog.d("String_Node_Str" + mOutputPath);
        }
      }
      mAudioEncoder=null;
      mVideoEncoder=null;
      mMuxer=null;
      mAudioTrack=-1;
      mVideoTrack=-1;
      isRecordStarted=false;
    }
  }
}
Program: 35734
Project: 35734
Buggy source:
public CameraRecorder2(){
  mMuxer=new Mp4MuxStore(true);
  mShower=new SurfaceShower();
  mShower.setOutputSize(720,1280);
  mSurfaceStore=new SurfaceEncoder();
  mSurfaceStore.setStore(mMuxer);
  mSoundRecord=new SoundRecorder(mMuxer);
  mTextureProcessor=new VideoSurfaceProcessor();
  mTextureProcessor.setTextureProvider(mCameraProvider=new CameraProvider());
  mTextureProcessor.addObserver(mShower);
  mTextureProcessor.addObserver(mSurfaceStore);
}

Fixed version (ground truth):
public CameraRecorder2(){
  mMuxer=new StrengthenMp4MuxStore(true);
  mShower=new SurfaceShower();
  mShower.setOutputSize(720,1280);
  mSurfaceStore=new SurfaceEncoder();
  mSurfaceStore.setStore(mMuxer);
  mSoundRecord=new SoundRecorder(mMuxer);
  mTextureProcessor=new VideoSurfaceProcessor();
  mTextureProcessor.setTextureProvider(mCameraProvider=new CameraProvider());
  mTextureProcessor.addObserver(mShower);
  mTextureProcessor.addObserver(mSurfaceStore);
}
Program: 35736
Project: 35736
Buggy source:
@Override public void run(){
  if (mVideoDecoderTrack >= 0) {
    Log.d(Aavt.debugTag,"String_Node_Str");
    codecNum=0;
    while (mCodecFlag && !videoDecodeStep()) {
    }
    ;
    Log.d(Aavt.debugTag,"String_Node_Str" + codecNum);
    mGLThreadFlag=false;
    try {
      mSem.release();
      mGLThread.join();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  if (mAudioDecoderTrack >= 0 && mVideoEncoderTrack >= 0) {
    ByteBuffer buffer=ByteBuffer.allocate(1024 * 32);
    while (mCodecFlag && !audioDecodeStep(buffer)) {
    }
    ;
    buffer.clear();
  }
  Log.d(Aavt.debugTag,"String_Node_Str");
  mCodecFlag=false;
  avStop();
  if (mProgressListener != null) {
    mProgressListener.onComplete(mOutputPath);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (mVideoDecoderTrack >= 0) {
    AvLog.d("String_Node_Str");
    codecNum=0;
    while (mCodecFlag && !videoDecodeStep()) {
    }
    ;
    AvLog.d("String_Node_Str" + codecNum);
    mGLThreadFlag=false;
    try {
      mSem.release();
      mGLThread.join();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  if (mAudioDecoderTrack >= 0 && mVideoEncoderTrack >= 0) {
    ByteBuffer buffer=ByteBuffer.allocate(1024 * 32);
    while (mCodecFlag && !audioDecodeStep(buffer)) {
    }
    ;
    buffer.clear();
  }
  AvLog.d("String_Node_Str");
  mCodecFlag=false;
  avStop();
  if (mProgressListener != null) {
    mProgressListener.onComplete(mOutputPath);
  }
}
Program: 35737
Project: 35737
Buggy source:
private void glRunnable(){
  mSem=new Semaphore(0);
  mDecodeSem=new Semaphore(1);
  boolean ret=mEGLHelper.createGLESWithSurface(new EGLConfigAttrs(),new EGLContextAttrs(),mOutputSurface);
  if (!ret) {
    return;
  }
  if (mRenderer == null) {
    mRenderer=new WrapRenderer(null);
  }
  mRenderer.create();
  mRenderer.sizeChanged(mOutputVideoWidth,mOutputVideoHeight);
  int frameNum=0;
  while (mGLThreadFlag) {
    try {
      Log.d(Aavt.debugTag,"String_Node_Str");
      mSem.acquire();
      Log.d(Aavt.debugTag,"String_Node_Str");
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    if (mGLThreadFlag) {
      mVideoSurfaceTexture.updateTexImage();
      mVideoSurfaceTexture.getTransformMatrix(mRenderer.getTextureMatrix());
      mRenderer.draw(mVideoTextureId);
      mEGLHelper.setPresentationTime(mEGLHelper.getDefaultSurface(),mVideoDecoderBufferInfo.presentationTimeUs * 1000);
      if (!isRenderToWindowSurface) {
        frameNum++;
        videoEncodeStep(false);
      }
      mEGLHelper.swapBuffers(mEGLHelper.getDefaultSurface());
    }
    if (mProgressListener != null) {
      mProgressListener.onProgress(getTotalVideoTime() * 1000L,mVideoDecoderBufferInfo.presentationTimeUs);
    }
    mDecodeSem.release();
  }
  Log.e(Aavt.debugTag,"String_Node_Str" + frameNum);
  if (!isRenderToWindowSurface) {
    videoEncodeStep(true);
  }
  mRenderer.destroy();
  mEGLHelper.destroyGLES(mEGLHelper.getDefaultSurface(),mEGLHelper.getDefaultContext());
}

Fixed version (ground truth):
private void glRunnable(){
  mSem=new Semaphore(0);
  mDecodeSem=new Semaphore(1);
  boolean ret=mEGLHelper.createGLESWithSurface(new EGLConfigAttrs(),new EGLContextAttrs(),mOutputSurface);
  if (!ret) {
    return;
  }
  if (mRenderer == null) {
    mRenderer=new WrapRenderer(null);
  }
  mRenderer.create();
  mRenderer.sizeChanged(mOutputVideoWidth,mOutputVideoHeight);
  int frameNum=0;
  while (mGLThreadFlag) {
    try {
      AvLog.d("String_Node_Str");
      mSem.acquire();
      AvLog.d("String_Node_Str");
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    if (mGLThreadFlag) {
      mVideoSurfaceTexture.updateTexImage();
      mVideoSurfaceTexture.getTransformMatrix(mRenderer.getTextureMatrix());
      mRenderer.draw(mVideoTextureId);
      mEGLHelper.setPresentationTime(mEGLHelper.getDefaultSurface(),mVideoDecoderBufferInfo.presentationTimeUs * 1000);
      if (!isRenderToWindowSurface) {
        frameNum++;
        videoEncodeStep(false);
      }
      mEGLHelper.swapBuffers(mEGLHelper.getDefaultSurface());
    }
    if (mProgressListener != null) {
      mProgressListener.onProgress(getTotalVideoTime() * 1000L,mVideoDecoderBufferInfo.presentationTimeUs);
    }
    mDecodeSem.release();
  }
  AvLog.d("String_Node_Str" + frameNum);
  if (!isRenderToWindowSurface) {
    videoEncodeStep(true);
  }
  mRenderer.destroy();
  mEGLHelper.destroyGLES(mEGLHelper.getDefaultSurface(),mEGLHelper.getDefaultContext());
}
Program: 35738
Project: 35738
Buggy source:
private boolean videoEncodeStep(boolean isEnd){
  if (isEnd) {
    mVideoEncoder.signalEndOfInputStream();
  }
  while (true) {
    int mOutputIndex=mVideoEncoder.dequeueOutputBuffer(mVideoEncoderBufferInfo,TIME_OUT);
    Log.d(Aavt.debugTag,"String_Node_Str" + mOutputIndex + "String_Node_Str"+ mVideoEncoderBufferInfo.presentationTimeUs);
    if (mOutputIndex >= 0) {
      ByteBuffer buffer=getOutputBuffer(mVideoEncoder,mOutputIndex);
      if (mVideoEncoderBufferInfo.size > 0) {
        mMuxer.writeSampleData(mVideoEncoderTrack,buffer,mVideoEncoderBufferInfo);
      }
      mVideoEncoder.releaseOutputBuffer(mOutputIndex,false);
    }
 else     if (mOutputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
      MediaFormat format=mVideoEncoder.getOutputFormat();
      Log.d(Aavt.debugTag,"String_Node_Str" + format.toString());
      mVideoEncoderTrack=mMuxer.addTrack(format);
      mMuxer.start();
synchronized (MUX_LOCK) {
        MUX_LOCK.notifyAll();
      }
    }
 else     if (mOutputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
      break;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean videoEncodeStep(boolean isEnd){
  if (isEnd) {
    mVideoEncoder.signalEndOfInputStream();
  }
  while (true) {
    int mOutputIndex=mVideoEncoder.dequeueOutputBuffer(mVideoEncoderBufferInfo,TIME_OUT);
    AvLog.d("String_Node_Str" + mOutputIndex + "String_Node_Str"+ mVideoEncoderBufferInfo.presentationTimeUs);
    if (mOutputIndex >= 0) {
      ByteBuffer buffer=getOutputBuffer(mVideoEncoder,mOutputIndex);
      if (mVideoEncoderBufferInfo.size > 0) {
        mMuxer.writeSampleData(mVideoEncoderTrack,buffer,mVideoEncoderBufferInfo);
      }
      mVideoEncoder.releaseOutputBuffer(mOutputIndex,false);
    }
 else     if (mOutputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
      MediaFormat format=mVideoEncoder.getOutputFormat();
      AvLog.d("String_Node_Str" + format.toString());
      mVideoEncoderTrack=mMuxer.addTrack(format);
      mMuxer.start();
synchronized (MUX_LOCK) {
        MUX_LOCK.notifyAll();
      }
    }
 else     if (mOutputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
      break;
    }
  }
  return false;
}
Program: 35740
Project: 35740
Buggy source:
private boolean audioDecodeStep(ByteBuffer buffer){
  boolean isTimeEnd=false;
  buffer.clear();
synchronized (Extractor_LOCK) {
    mExtractor.selectTrack(mAudioDecoderTrack);
    int length=mExtractor.readSampleData(buffer,0);
    if (length != -1) {
      int flags=mExtractor.getSampleFlags();
      mAudioEncoderBufferInfo.size=length;
      mAudioEncoderBufferInfo.flags=flags;
      mAudioEncoderBufferInfo.presentationTimeUs=mExtractor.getSampleTime();
      mAudioEncoderBufferInfo.offset=0;
      Log.e(Aavt.debugTag,"String_Node_Str" + mAudioEncoderBufferInfo.presentationTimeUs);
      isTimeEnd=mExtractor.getSampleTime() >= mVideoStopTimeStamp;
      mMuxer.writeSampleData(mAudioEncoderTrack,buffer,mAudioEncoderBufferInfo);
    }
    isAudioExtractorEnd=!mExtractor.advance();
  }
  return isAudioExtractorEnd || isTimeEnd;
}

Fixed version (ground truth):
private boolean audioDecodeStep(ByteBuffer buffer){
  boolean isTimeEnd=false;
  buffer.clear();
synchronized (Extractor_LOCK) {
    mExtractor.selectTrack(mAudioDecoderTrack);
    int length=mExtractor.readSampleData(buffer,0);
    if (length != -1) {
      int flags=mExtractor.getSampleFlags();
      mAudioEncoderBufferInfo.size=length;
      mAudioEncoderBufferInfo.flags=flags;
      mAudioEncoderBufferInfo.presentationTimeUs=mExtractor.getSampleTime();
      mAudioEncoderBufferInfo.offset=0;
      AvLog.d("String_Node_Str" + mAudioEncoderBufferInfo.presentationTimeUs);
      isTimeEnd=mExtractor.getSampleTime() >= mVideoStopTimeStamp;
      mMuxer.writeSampleData(mAudioEncoderTrack,buffer,mAudioEncoderBufferInfo);
    }
    isAudioExtractorEnd=!mExtractor.advance();
  }
  return isAudioExtractorEnd || isTimeEnd;
}
Program: 35741
Project: 35741
Buggy source:
public boolean stop() throws InterruptedException {
synchronized (PROCESS_LOCK) {
    if (isStarted) {
      if (mCodecFlag) {
        mDecodeSem.release();
        isUserWantToStop=true;
        if (mDecodeThread != null && mDecodeThread.isAlive()) {
          Log.d(Aavt.debugTag,"String_Node_Str");
          mDecodeThread.join();
          Log.d(Aavt.debugTag,"String_Node_Str");
        }
        isUserWantToStop=false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean stop() throws InterruptedException {
synchronized (PROCESS_LOCK) {
    if (isStarted) {
      if (mCodecFlag) {
        mDecodeSem.release();
        isUserWantToStop=true;
        if (mDecodeThread != null && mDecodeThread.isAlive()) {
          AvLog.d("String_Node_Str");
          mDecodeThread.join();
          AvLog.d("String_Node_Str");
        }
        isUserWantToStop=false;
      }
    }
  }
  return true;
}
Program: 35742
Project: 35742
Buggy source:
private boolean videoDecodeStep(){
  int mInputIndex=mVideoDecoder.dequeueInputBuffer(TIME_OUT);
  if (mInputIndex >= 0) {
    ByteBuffer buffer=getInputBuffer(mVideoDecoder,mInputIndex);
    buffer.clear();
synchronized (Extractor_LOCK) {
      mExtractor.selectTrack(mVideoDecoderTrack);
      int ret=mExtractor.readSampleData(buffer,0);
      if (ret != -1) {
        mVideoStopTimeStamp=mExtractor.getSampleTime();
        Log.d(Aavt.debugTag,"String_Node_Str" + mVideoStopTimeStamp);
        mVideoDecoder.queueInputBuffer(mInputIndex,0,ret,mVideoStopTimeStamp,mExtractor.getSampleFlags());
      }
      isVideoExtractorEnd=!mExtractor.advance();
    }
  }
  while (true) {
    int mOutputIndex=mVideoDecoder.dequeueOutputBuffer(mVideoDecoderBufferInfo,TIME_OUT);
    if (mOutputIndex >= 0) {
      try {
        Log.d(Aavt.debugTag,"String_Node_Str");
        if (!isUserWantToStop) {
          mDecodeSem.acquire();
        }
        Log.d(Aavt.debugTag,"String_Node_Str");
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      codecNum++;
      mVideoDecoder.releaseOutputBuffer(mOutputIndex,true);
      mSem.release();
    }
 else     if (mOutputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
    }
 else     if (mOutputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
      break;
    }
  }
  return isVideoExtractorEnd || isUserWantToStop;
}

Fixed version (ground truth):
private boolean videoDecodeStep(){
  int mInputIndex=mVideoDecoder.dequeueInputBuffer(TIME_OUT);
  if (mInputIndex >= 0) {
    ByteBuffer buffer=getInputBuffer(mVideoDecoder,mInputIndex);
    buffer.clear();
synchronized (Extractor_LOCK) {
      mExtractor.selectTrack(mVideoDecoderTrack);
      int ret=mExtractor.readSampleData(buffer,0);
      if (ret != -1) {
        mVideoStopTimeStamp=mExtractor.getSampleTime();
        AvLog.d("String_Node_Str" + mVideoStopTimeStamp);
        mVideoDecoder.queueInputBuffer(mInputIndex,0,ret,mVideoStopTimeStamp,mExtractor.getSampleFlags());
      }
      isVideoExtractorEnd=!mExtractor.advance();
    }
  }
  while (true) {
    int mOutputIndex=mVideoDecoder.dequeueOutputBuffer(mVideoDecoderBufferInfo,TIME_OUT);
    if (mOutputIndex >= 0) {
      try {
        AvLog.d("String_Node_Str");
        if (!isUserWantToStop) {
          mDecodeSem.acquire();
        }
        AvLog.d("String_Node_Str");
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      codecNum++;
      mVideoDecoder.releaseOutputBuffer(mOutputIndex,true);
      mSem.release();
    }
 else     if (mOutputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
    }
 else     if (mOutputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
      break;
    }
  }
  return isVideoExtractorEnd || isUserWantToStop;
}
Program: 35743
Project: 35743
Buggy source:
public boolean destroyGLES(EGLSurface surface,EGLContext context){
  EGL14.eglMakeCurrent(mEGLDisplay,EGL14.EGL_NO_SURFACE,EGL14.EGL_NO_SURFACE,EGL14.EGL_NO_CONTEXT);
  EGL14.eglDestroySurface(mEGLDisplay,surface);
  EGL14.eglDestroyContext(mEGLDisplay,context);
  EGL14.eglTerminate(mEGLDisplay);
  log("String_Node_Str");
  return true;
}

Fixed version (ground truth):
public boolean destroyGLES(EGLSurface surface,EGLContext context){
  EGL14.eglMakeCurrent(mEGLDisplay,EGL14.EGL_NO_SURFACE,EGL14.EGL_NO_SURFACE,EGL14.EGL_NO_CONTEXT);
  if (surface != null) {
    EGL14.eglDestroySurface(mEGLDisplay,surface);
  }
  if (context != null) {
    EGL14.eglDestroyContext(mEGLDisplay,context);
  }
  EGL14.eglTerminate(mEGLDisplay);
  log("String_Node_Str");
  return true;
}
Program: 35744
Project: 35744
Buggy source:
private boolean extractMedia(){
  if (mPath == null || !new File(mPath).exists()) {
    return false;
  }
  try {
    MediaMetadataRetriever mMetRet=new MediaMetadataRetriever();
    mMetRet.setDataSource(mPath);
    mExtractor=new MediaExtractor();
    mExtractor.setDataSource(mPath);
    int trackCount=mExtractor.getTrackCount();
    for (int i=0; i < trackCount; i++) {
      MediaFormat format=mExtractor.getTrackFormat(i);
      String mime=format.getString(MediaFormat.KEY_MIME);
      if (mime.startsWith("String_Node_Str")) {
        mAudioDecodeTrack=i;
      }
 else       if (mime.startsWith("String_Node_Str")) {
        mVideoDecodeTrack=i;
        int videoRotation=0;
        String rotation=mMetRet.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);
        if (rotation != null) {
          videoRotation=Integer.valueOf(rotation);
        }
        if (videoRotation % 180 != 0) {
          mVideoSize.y=format.getInteger(MediaFormat.KEY_WIDTH);
          mVideoSize.x=format.getInteger(MediaFormat.KEY_HEIGHT);
        }
 else {
          mVideoSize.x=format.getInteger(MediaFormat.KEY_WIDTH);
          mVideoSize.y=format.getInteger(MediaFormat.KEY_HEIGHT);
        }
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean extractMedia(){
  if (mPath == null || !new File(mPath).exists()) {
    return false;
  }
  try {
    MediaMetadataRetriever mMetRet=new MediaMetadataRetriever();
    mMetRet.setDataSource(mPath);
    mVideoTotalTime=Long.valueOf(mMetRet.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION));
    mExtractor=new MediaExtractor();
    mExtractor.setDataSource(mPath);
    int trackCount=mExtractor.getTrackCount();
    for (int i=0; i < trackCount; i++) {
      MediaFormat format=mExtractor.getTrackFormat(i);
      String mime=format.getString(MediaFormat.KEY_MIME);
      if (mime.startsWith("String_Node_Str")) {
        mAudioDecodeTrack=i;
      }
 else       if (mime.startsWith("String_Node_Str")) {
        mVideoDecodeTrack=i;
        int videoRotation=0;
        String rotation=mMetRet.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);
        if (rotation != null) {
          videoRotation=Integer.valueOf(rotation);
        }
        if (videoRotation % 180 != 0) {
          mVideoSize.y=format.getInteger(MediaFormat.KEY_WIDTH);
          mVideoSize.x=format.getInteger(MediaFormat.KEY_HEIGHT);
        }
 else {
          mVideoSize.x=format.getInteger(MediaFormat.KEY_WIDTH);
          mVideoSize.y=format.getInteger(MediaFormat.KEY_HEIGHT);
        }
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
    return false;
  }
  return true;
}
Program: 35748
Project: 35748
Buggy source:
@Override public void run(){
  if (mVideoDecoderTrack >= 0) {
    while (mCodecFlag && !videoDecodeStep())     ;
    mGLThreadFlag=false;
    try {
      mSem.release();
      mGLThread.join();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  if (mAudioDecoderTrack >= 0) {
    ByteBuffer buffer=ByteBuffer.allocate(1024 * 32);
    while (mCodecFlag && !audioDecodeStep(buffer))     ;
    buffer.clear();
  }
  mMuxer.stop();
  if (mCompleteListener != null && mCodecFlag) {
    mCompleteListener.onComplete(mOutputPath);
  }
  Log.d(Aavt.debugTag,"String_Node_Str");
  mCodecFlag=false;
  try {
    stop();
  }
 catch (  InterruptedException e) {
    Log.e(Aavt.debugTag,"String_Node_Str");
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (mVideoDecoderTrack >= 0) {
    Log.d(Aavt.debugTag,"String_Node_Str");
    while (mCodecFlag && !videoDecodeStep())     ;
    Log.d(Aavt.debugTag,"String_Node_Str");
    mGLThreadFlag=false;
    try {
      mSem.release();
      mGLThread.join();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  if (mAudioDecoderTrack >= 0 && mVideoEncoderTrack >= 0) {
    ByteBuffer buffer=ByteBuffer.allocate(1024 * 32);
    while (mCodecFlag && !audioDecodeStep(buffer))     ;
    buffer.clear();
  }
  Log.d(Aavt.debugTag,"String_Node_Str");
  mCodecFlag=false;
  avStop();
  if (mCompleteListener != null) {
    mCompleteListener.onComplete(mOutputPath);
  }
}
Program: 35749
Project: 35749
Buggy source:
private boolean audioDecodeStep(ByteBuffer buffer){
  buffer.clear();
synchronized (Extractor_LOCK) {
    mExtractor.selectTrack(mAudioDecoderTrack);
    int length=mExtractor.readSampleData(buffer,0);
    if (length != -1) {
      int flags=mExtractor.getSampleFlags();
      mAudioEncoderBufferInfo.size=length;
      mAudioEncoderBufferInfo.flags=flags;
      mAudioEncoderBufferInfo.presentationTimeUs=mExtractor.getSampleTime();
      mAudioEncoderBufferInfo.offset=0;
      mMuxer.writeSampleData(mAudioEncoderTrack,buffer,mAudioEncoderBufferInfo);
    }
    isAudioExtractorEnd=!mExtractor.advance();
  }
  return isAudioExtractorEnd;
}

Fixed version (ground truth):
private boolean audioDecodeStep(ByteBuffer buffer){
  boolean isTimeEnd=false;
  buffer.clear();
synchronized (Extractor_LOCK) {
    mExtractor.selectTrack(mAudioDecoderTrack);
    int length=mExtractor.readSampleData(buffer,0);
    if (length != -1) {
      int flags=mExtractor.getSampleFlags();
      mAudioEncoderBufferInfo.size=length;
      mAudioEncoderBufferInfo.flags=flags;
      mAudioEncoderBufferInfo.presentationTimeUs=mExtractor.getSampleTime();
      mAudioEncoderBufferInfo.offset=0;
      isTimeEnd=mExtractor.getSampleTime() >= mVideoStopTimeStamp;
      mMuxer.writeSampleData(mAudioEncoderTrack,buffer,mAudioEncoderBufferInfo);
    }
    isAudioExtractorEnd=!mExtractor.advance();
  }
  return isAudioExtractorEnd || isTimeEnd;
}
Program: 35750
Project: 35750
Buggy source:
public boolean stop() throws InterruptedException {
synchronized (PROCESS_LOCK) {
    if (isStarted) {
      Log.d(Aavt.debugTag,"String_Node_Str");
      boolean del=false;
      if (mCodecFlag) {
        del=true;
        mCodecFlag=false;
        if (mDecodeThread != null && mDecodeThread.isAlive()) {
          Log.d(Aavt.debugTag,"String_Node_Str");
          mDecodeThread.join();
          Log.d(Aavt.debugTag,"String_Node_Str");
        }
      }
      if (mVideoDecoder != null) {
        mVideoDecoder.stop();
        mVideoDecoder.release();
        mVideoDecoder=null;
      }
      if (!isRenderToWindowSurface && mVideoEncoder != null) {
        mVideoEncoder.stop();
        mVideoEncoder.release();
        mVideoEncoder=null;
      }
      if (del && !isRenderToWindowSurface) {
        if (mMuxer != null) {
          mMuxer.stop();
        }
      }
      if (del) {
        Log.d(Aavt.debugTag,"String_Node_Str");
        File file=new File(mOutputPath);
        if (file.exists()) {
          file.delete();
        }
      }
      if (mMuxer != null) {
        mMuxer.release();
        mMuxer=null;
      }
      if (mExtractor != null) {
        mExtractor.release();
      }
      isStarted=false;
      Log.d(Aavt.debugTag,"String_Node_Str");
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean stop() throws InterruptedException {
synchronized (PROCESS_LOCK) {
    if (isStarted) {
      if (mCodecFlag) {
        mDecodeSem.release();
        isUserWantToStop=true;
        if (mDecodeThread != null && mDecodeThread.isAlive()) {
          Log.d(Aavt.debugTag,"String_Node_Str");
          mDecodeThread.join();
          Log.d(Aavt.debugTag,"String_Node_Str");
        }
        isUserWantToStop=false;
      }
    }
  }
  return true;
}
Program: 35751
Project: 35751
Buggy source:
private void glRunnable(){
  mSem=new Semaphore(0);
  mDecodeSem=new Semaphore(1);
  mEGLHelper.setSurface(mOutputSurface);
  boolean ret=mEGLHelper.createGLES(mOutputVideoWidth,mOutputVideoHeight);
  if (!ret)   return;
  if (mRenderer == null) {
    mRenderer=new WrapRenderer(null);
  }
  mRenderer.create();
  mRenderer.sizeChanged(mOutputVideoWidth,mOutputVideoHeight);
  while (mGLThreadFlag) {
    try {
      mSem.acquire();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    if (mGLThreadFlag) {
      mVideoSurfaceTexture.updateTexImage();
      mVideoSurfaceTexture.getTransformMatrix(mRenderer.getTextureMatrix());
      mRenderer.draw(mVideoTextureId);
      mEGLHelper.setPresentationTime(mVideoDecoderBufferInfo.presentationTimeUs * 1000);
      if (!isRenderToWindowSurface) {
        videoEncodeStep(false);
      }
      mEGLHelper.swapBuffers();
    }
    mDecodeSem.release();
  }
  if (!isRenderToWindowSurface) {
    videoEncodeStep(true);
  }
  mEGLHelper.destroyGLES();
  mRenderer.destroy();
}

Fixed version (ground truth):
private void glRunnable(){
  mSem=new Semaphore(0);
  mDecodeSem=new Semaphore(1);
  mEGLHelper.setSurface(mOutputSurface);
  boolean ret=mEGLHelper.createGLES(mOutputVideoWidth,mOutputVideoHeight);
  if (!ret)   return;
  if (mRenderer == null) {
    mRenderer=new WrapRenderer(null);
  }
  mRenderer.create();
  mRenderer.sizeChanged(mOutputVideoWidth,mOutputVideoHeight);
  while (mGLThreadFlag) {
    try {
      Log.d(Aavt.debugTag,"String_Node_Str");
      mSem.acquire();
      Log.d(Aavt.debugTag,"String_Node_Str");
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    if (mGLThreadFlag) {
      mVideoSurfaceTexture.updateTexImage();
      mVideoSurfaceTexture.getTransformMatrix(mRenderer.getTextureMatrix());
      mRenderer.draw(mVideoTextureId);
      mEGLHelper.setPresentationTime(mVideoDecoderBufferInfo.presentationTimeUs * 1000);
      if (!isRenderToWindowSurface) {
        videoEncodeStep(false);
      }
      mEGLHelper.swapBuffers();
    }
    mDecodeSem.release();
  }
  if (!isRenderToWindowSurface) {
    videoEncodeStep(true);
  }
  mEGLHelper.destroyGLES();
  mRenderer.destroy();
}
Program: 35752
Project: 35752
Buggy source:
@Override public void onFrameAvailable(SurfaceTexture surfaceTexture){
  mSem.release();
}

Fixed version (ground truth):
@Override public void onFrameAvailable(SurfaceTexture surfaceTexture){
  Log.e(Aavt.debugTag,"String_Node_Str");
  mSem.release();
}
Program: 35753
Project: 35753
Buggy source:
private boolean videoDecodeStep(){
  int mInputIndex=mVideoDecoder.dequeueInputBuffer(TIME_OUT);
  if (mInputIndex >= 0) {
    ByteBuffer buffer=getInputBuffer(mVideoDecoder,mInputIndex);
    buffer.clear();
synchronized (Extractor_LOCK) {
      mExtractor.selectTrack(mVideoDecoderTrack);
      int ret=mExtractor.readSampleData(buffer,0);
      if (ret != -1) {
        mVideoDecoder.queueInputBuffer(mInputIndex,0,ret,mExtractor.getSampleTime(),mExtractor.getSampleFlags());
      }
      isVideoExtractorEnd=!mExtractor.advance();
    }
  }
  while (true) {
    int mOutputIndex=mVideoDecoder.dequeueOutputBuffer(mVideoDecoderBufferInfo,TIME_OUT);
    if (mOutputIndex >= 0) {
      try {
        mDecodeSem.acquire();
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      mVideoDecoder.releaseOutputBuffer(mOutputIndex,true);
    }
 else     if (mOutputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
    }
 else     if (mOutputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
      break;
    }
  }
  return isVideoExtractorEnd;
}

Fixed version (ground truth):
private boolean videoDecodeStep(){
  int mInputIndex=mVideoDecoder.dequeueInputBuffer(TIME_OUT);
  if (mInputIndex >= 0) {
    ByteBuffer buffer=getInputBuffer(mVideoDecoder,mInputIndex);
    buffer.clear();
synchronized (Extractor_LOCK) {
      mExtractor.selectTrack(mVideoDecoderTrack);
      int ret=mExtractor.readSampleData(buffer,0);
      if (ret != -1) {
        mVideoStopTimeStamp=mExtractor.getSampleTime();
        mVideoDecoder.queueInputBuffer(mInputIndex,0,ret,mVideoStopTimeStamp,mExtractor.getSampleFlags());
      }
      isVideoExtractorEnd=!mExtractor.advance();
    }
  }
  while (true) {
    int mOutputIndex=mVideoDecoder.dequeueOutputBuffer(mVideoDecoderBufferInfo,TIME_OUT);
    if (mOutputIndex >= 0) {
      try {
        Log.d(Aavt.debugTag,"String_Node_Str");
        if (!isUserWantToStop) {
          mDecodeSem.acquire();
        }
        Log.d(Aavt.debugTag,"String_Node_Str");
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      mVideoDecoder.releaseOutputBuffer(mOutputIndex,true);
    }
 else     if (mOutputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
    }
 else     if (mOutputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
      break;
    }
  }
  return isVideoExtractorEnd || isUserWantToStop;
}
Program: 35754
Project: 35754
Buggy source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_mp4);
  mProcessor=new Mp4Processor();
  mProcessor.setOutputPath(Environment.getExternalStorageDirectory().getAbsolutePath() + "String_Node_Str");
  mProcessor.setOnCompleteListener(new Mp4Processor.CompleteListener(){
    @Override public void onComplete(    String path){
      runOnUiThread(new Runnable(){
        @Override public void run(){
          Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
        }
      }
);
    }
  }
);
  mProcessor.setRenderer(new Renderer(){
    Filter filter;
    @Override public void create(){
      filter=new GrayFilter(getResources());
      filter.create();
    }
    @Override public void sizeChanged(    int width,    int height){
      filter.sizeChanged(width,height);
    }
    @Override public void draw(    int texture){
      filter.draw(texture);
    }
    @Override public void destroy(){
      filter.destroy();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_mp4);
  mProcessor=new Mp4Processor();
  mProcessor.setOutputPath(Environment.getExternalStorageDirectory().getAbsolutePath() + "String_Node_Str");
  mProcessor.setOnCompleteListener(new Mp4Processor.CompleteListener(){
    @Override public void onComplete(    String path){
      runOnUiThread(new Runnable(){
        @Override public void run(){
          Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
        }
      }
);
    }
  }
);
  mProcessor.setRenderer(new Renderer(){
    Filter filter;
    @Override public void create(){
      filter=new SobelFilter(getResources());
      filter.create();
    }
    @Override public void sizeChanged(    int width,    int height){
      filter.sizeChanged(width,height);
    }
    @Override public void draw(    int texture){
      filter.draw(texture);
    }
    @Override public void destroy(){
      filter.destroy();
    }
  }
);
}
Program: 35755
Project: 35755
Buggy source:
@Override public void create(){
  filter=new GrayFilter(getResources());
  filter.create();
}

Fixed version (ground truth):
@Override public void create(){
  filter=new SobelFilter(getResources());
  filter.create();
}
Program: 35756
Project: 35756
Buggy source:
private void glRunnable(){
  mSem=new Semaphore(0);
  mEGLHelper.setSurface(mOutputSurface);
  boolean ret=mEGLHelper.createGLES(mOutputVideoWidth,mOutputVideoHeight);
  if (!ret)   return;
  if (mRenderer == null) {
    mRenderer=new WrapRenderer(null);
  }
  mRenderer.create();
  mRenderer.sizeChanged(mOutputVideoWidth,mOutputVideoHeight);
  while (mGLThreadFlag) {
    try {
      mSem.acquire();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    if (mGLThreadFlag) {
      mVideoSurfaceTexture.updateTexImage();
      mVideoSurfaceTexture.getTransformMatrix(mRenderer.getTextureMatrix());
      mRenderer.draw(mVideoTextureId);
      mEGLHelper.setPresentationTime(mVideoDecoderBufferInfo.presentationTimeUs * 1000);
      if (!isRenderToWindowSurface) {
        videoEncodeStep(false);
      }
      mEGLHelper.swapBuffers();
    }
  }
  if (!isRenderToWindowSurface) {
    videoEncodeStep(true);
  }
  mEGLHelper.destroyGLES();
  mRenderer.destroy();
}

Fixed version (ground truth):
private void glRunnable(){
  mSem=new Semaphore(0);
  mDecodeSem=new Semaphore(1);
  mEGLHelper.setSurface(mOutputSurface);
  boolean ret=mEGLHelper.createGLES(mOutputVideoWidth,mOutputVideoHeight);
  if (!ret)   return;
  if (mRenderer == null) {
    mRenderer=new WrapRenderer(null);
  }
  mRenderer.create();
  mRenderer.sizeChanged(mOutputVideoWidth,mOutputVideoHeight);
  while (mGLThreadFlag) {
    try {
      mSem.acquire();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    if (mGLThreadFlag) {
      mVideoSurfaceTexture.updateTexImage();
      mVideoSurfaceTexture.getTransformMatrix(mRenderer.getTextureMatrix());
      mRenderer.draw(mVideoTextureId);
      mEGLHelper.setPresentationTime(mVideoDecoderBufferInfo.presentationTimeUs * 1000);
      if (!isRenderToWindowSurface) {
        videoEncodeStep(false);
      }
      mEGLHelper.swapBuffers();
    }
    mDecodeSem.release();
  }
  if (!isRenderToWindowSurface) {
    videoEncodeStep(true);
  }
  mEGLHelper.destroyGLES();
  mRenderer.destroy();
}
Program: 35757
Project: 35757
Buggy source:
private boolean videoDecodeStep(){
  int mInputIndex=mVideoDecoder.dequeueInputBuffer(TIME_OUT);
  if (mInputIndex >= 0) {
    ByteBuffer buffer=getInputBuffer(mVideoDecoder,mInputIndex);
    buffer.clear();
synchronized (Extractor_LOCK) {
      mExtractor.selectTrack(mVideoDecoderTrack);
      int ret=mExtractor.readSampleData(buffer,0);
      if (ret != -1) {
        mVideoDecoder.queueInputBuffer(mInputIndex,0,ret,mExtractor.getSampleTime(),mExtractor.getSampleFlags());
      }
      isVideoExtractorEnd=!mExtractor.advance();
    }
  }
  while (true) {
    int mOutputIndex=mVideoDecoder.dequeueOutputBuffer(mVideoDecoderBufferInfo,TIME_OUT);
    if (mOutputIndex >= 0) {
      mVideoDecoder.releaseOutputBuffer(mOutputIndex,true);
    }
 else     if (mOutputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
    }
 else     if (mOutputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
      break;
    }
  }
  return isVideoExtractorEnd;
}

Fixed version (ground truth):
private boolean videoDecodeStep(){
  int mInputIndex=mVideoDecoder.dequeueInputBuffer(TIME_OUT);
  if (mInputIndex >= 0) {
    ByteBuffer buffer=getInputBuffer(mVideoDecoder,mInputIndex);
    buffer.clear();
synchronized (Extractor_LOCK) {
      mExtractor.selectTrack(mVideoDecoderTrack);
      int ret=mExtractor.readSampleData(buffer,0);
      if (ret != -1) {
        mVideoDecoder.queueInputBuffer(mInputIndex,0,ret,mExtractor.getSampleTime(),mExtractor.getSampleFlags());
      }
      isVideoExtractorEnd=!mExtractor.advance();
    }
  }
  while (true) {
    int mOutputIndex=mVideoDecoder.dequeueOutputBuffer(mVideoDecoderBufferInfo,TIME_OUT);
    if (mOutputIndex >= 0) {
      try {
        mDecodeSem.acquire();
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      mVideoDecoder.releaseOutputBuffer(mOutputIndex,true);
    }
 else     if (mOutputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
    }
 else     if (mOutputIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {
      break;
    }
  }
  return isVideoExtractorEnd;
}
Program: 35758
Project: 35758
Buggy source:
@Test public void login() throws Exception {
  LoginRequest loginRequest=new LoginRequest();
  loginRequest.setUsername("String_Node_Str");
  loginRequest.setPassword("String_Node_Str");
  AuthDto authDto=authApi.login(loginRequest);
  assertThat(authDto).isNotNull();
  System.out.println(authDto.getAccessToken());
}

Fixed version (ground truth):
@Test public void login() throws Exception {
  LoginRequest loginRequest=new LoginRequest();
  loginRequest.setUsername("String_Node_Str");
  loginRequest.setPassword("String_Node_Str");
}
Program: 35759
Project: 35759
Buggy source:
@Autowired public ArticleController(ArticleService articleService,CommentService commentService,UserService userService){
  this.articleService=articleService;
  this.commentService=commentService;
  this.userService=userService;
}

Fixed version (ground truth):
@Autowired public ArticleController(ArticleService articleService,CommentService commentService){
  this.articleService=articleService;
  this.commentService=commentService;
}
Program: 35760
Project: 35760
Buggy source:
@ApiOperation(value="String_Node_Str",httpMethod="String_Node_Str") @PostMapping("String_Node_Str") @ResponseStatus(HttpStatus.CREATED) public void createArticleComment(@PathVariable Long articleId,@Valid @RequestBody CommentRequest commentRequest,@CurrentUser User user){
  commentService.create(articleId,user.getId(),commentRequest);
}

Fixed version (ground truth):
@ApiOperation(value="String_Node_Str",httpMethod="String_Node_Str") @PostMapping("String_Node_Str") @ResponseStatus(HttpStatus.CREATED) public void createArticleComment(@PathVariable Long articleId,@Valid @RequestBody CommentRequest commentRequest,@CurrentUser UserResponse user){
  commentService.create(articleId,user.getId(),commentRequest);
}
Program: 35761
Project: 35761
Buggy source:
public void runBatchPerfTestIndexed(){
  List<SimpleEntityIndexed> list=new ArrayList<>(numberEntities);
  for (int i=0; i < numberEntities; i++) {
    list.add(createEntityIndexed((long)i));
  }
  startBenchmark("String_Node_Str");
  daoIndexed.insertInTx(list);
  stopBenchmark();
  for (  SimpleEntityIndexed entity : list) {
    setRandomValues(entity);
  }
  startBenchmark("String_Node_Str");
  daoIndexed.updateInTx(list);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  List<SimpleEntityIndexed> reloaded=daoIndexed.loadAll();
  stopBenchmark();
  startBenchmark("String_Node_Str");
  accessAllIndexed(reloaded);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  daoIndexed.deleteInTx(reloaded);
  stopBenchmark();
}

Fixed version (ground truth):
public void runBatchPerfTestIndexed(){
  List<SimpleEntityIndexed> list=new ArrayList<>(numberEntities);
  for (int i=0; i < numberEntities; i++) {
    list.add(createEntityIndexed((long)i));
  }
  startBenchmark("String_Node_Str");
  daoIndexed.insertInTx(list);
  stopBenchmark();
  for (  SimpleEntityIndexed entity : list) {
    setRandomValues(entity);
  }
  startBenchmark("String_Node_Str");
  daoIndexed.updateInTx(list);
  stopBenchmark();
  list=null;
  startBenchmark("String_Node_Str");
  List<SimpleEntityIndexed> reloaded=daoIndexed.loadAll();
  stopBenchmark();
  startBenchmark("String_Node_Str");
  accessAllIndexed(reloaded);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  daoIndexed.deleteInTx(reloaded);
  stopBenchmark();
}
Program: 35762
Project: 35762
Buggy source:
public void runBatchPerfTest(boolean scalarsOnly){
  List<SimpleEntity> list=new ArrayList<>(numberEntities);
  for (int i=0; i < numberEntities; i++) {
    list.add(createEntity((long)i,scalarsOnly));
  }
  startBenchmark("String_Node_Str");
  dao.insertInTx(list);
  stopBenchmark();
  for (  SimpleEntity entity : list) {
    if (scalarsOnly) {
      setRandomScalars(entity);
    }
 else {
      setRandomValues(entity);
    }
  }
  startBenchmark("String_Node_Str");
  dao.updateInTx(list);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  List<SimpleEntity> reloaded=dao.loadAll();
  stopBenchmark();
  startBenchmark("String_Node_Str");
  accessAll(reloaded);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  dao.deleteInTx(reloaded);
  stopBenchmark();
}

Fixed version (ground truth):
public void runBatchPerfTest(boolean scalarsOnly){
  List<SimpleEntity> list=new ArrayList<>(numberEntities);
  for (int i=0; i < numberEntities; i++) {
    list.add(createEntity((long)i,scalarsOnly));
  }
  startBenchmark("String_Node_Str");
  dao.insertInTx(list);
  stopBenchmark();
  for (  SimpleEntity entity : list) {
    if (scalarsOnly) {
      setRandomScalars(entity);
    }
 else {
      setRandomValues(entity);
    }
  }
  startBenchmark("String_Node_Str");
  dao.updateInTx(list);
  stopBenchmark();
  list=null;
  startBenchmark("String_Node_Str");
  List<SimpleEntity> reloaded=dao.loadAll();
  stopBenchmark();
  startBenchmark("String_Node_Str");
  accessAll(reloaded);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  dao.deleteInTx(reloaded);
  stopBenchmark();
}
Program: 35763
Project: 35763
Buggy source:
public void runBatchPerfTestIndexed(){
  List<SimpleEntityIndexed> list=new ArrayList<>(numberEntities);
  for (int i=0; i < numberEntities; i++) {
    list.add(createEntityIndexed());
  }
  startBenchmark("String_Node_Str");
  boxIndexed.put(list);
  stopBenchmark();
  for (  SimpleEntityIndexed entity : list) {
    setRandomValues(entity);
  }
  startBenchmark("String_Node_Str");
  boxIndexed.put(list);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  List<SimpleEntityIndexed> reloaded=boxIndexed.getAll();
  stopBenchmark();
  startBenchmark("String_Node_Str");
  accessAllIndexed(reloaded);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  boxIndexed.removeAll();
  stopBenchmark();
}

Fixed version (ground truth):
public void runBatchPerfTestIndexed(){
  List<SimpleEntityIndexed> list=new ArrayList<>(numberEntities);
  for (int i=0; i < numberEntities; i++) {
    list.add(createEntityIndexed());
  }
  startBenchmark("String_Node_Str");
  boxIndexed.put(list);
  stopBenchmark();
  for (  SimpleEntityIndexed entity : list) {
    setRandomValues(entity);
  }
  startBenchmark("String_Node_Str");
  boxIndexed.put(list);
  stopBenchmark();
  list=null;
  startBenchmark("String_Node_Str");
  List<SimpleEntityIndexed> reloaded=boxIndexed.getAll();
  stopBenchmark();
  startBenchmark("String_Node_Str");
  accessAllIndexed(reloaded);
  stopBenchmark();
  startBenchmark("String_Node_Str");
  boxIndexed.remove(reloaded);
  stopBenchmark();
}