Program: 110395
Project: 110395
Buggy source:
@Override public void onDrawFrame(GL10 unused){
  VpxOutputBuffer pendingOutputBuffer=pendingOutputBufferReference.getAndSet(null);
  if (pendingOutputBuffer == null && renderedOutputBuffer == null) {
    return;
  }
  if (pendingOutputBuffer != null) {
    if (renderedOutputBuffer != null) {
      renderedOutputBuffer.release();
    }
    renderedOutputBuffer=pendingOutputBuffer;
  }
  VpxOutputBuffer outputBuffer=renderedOutputBuffer;
  float[] colorConversion=outputBuffer.colorspace == VpxOutputBuffer.COLORSPACE_BT601 ? kColorConversion601 : kColorConversion709;
  GLES20.glUniformMatrix3fv(colorMatrixLocation,1,false,colorConversion,0);
  for (int i=0; i < 3; i++) {
    int h=(i == 0) ? outputBuffer.height : (outputBuffer.height + 1) / 2;
    GLES20.glActiveTexture(GLES20.GL_TEXTURE0 + i);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D,yuvTextures[i]);
    GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT,1);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D,0,GLES20.GL_LUMINANCE,outputBuffer.yuvStrides[i],h,0,GLES20.GL_LUMINANCE,GLES20.GL_UNSIGNED_BYTE,outputBuffer.yuvPlanes[i]);
  }
  if (previousWidth != outputBuffer.width || previousStride != outputBuffer.yuvStrides[0]) {
    float crop=(float)outputBuffer.width / outputBuffer.yuvStrides[0];
    FloatBuffer textureCoords=nativeFloatBuffer(0.0f,0.0f,0.0f,1.0f,crop,0.0f,crop,1.0f);
    GLES20.glVertexAttribPointer(texLocation,2,GLES20.GL_FLOAT,false,0,textureCoords);
    previousWidth=outputBuffer.width;
    previousStride=outputBuffer.yuvStrides[0];
  }
  GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
  GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP,0,4);
  checkNoGLES2Error();
}

Fixed version (ground truth):
@Override public void onDrawFrame(GL10 unused){
  VpxOutputBuffer pendingOutputBuffer=pendingOutputBufferReference.getAndSet(null);
  if (pendingOutputBuffer == null && renderedOutputBuffer == null) {
    return;
  }
  if (pendingOutputBuffer != null) {
    if (renderedOutputBuffer != null) {
      renderedOutputBuffer.release();
    }
    renderedOutputBuffer=pendingOutputBuffer;
  }
  VpxOutputBuffer outputBuffer=renderedOutputBuffer;
  float[] colorConversion=outputBuffer.colorspace == VpxOutputBuffer.COLORSPACE_BT601 ? kColorConversion601 : kColorConversion709;
  GLES20.glUniformMatrix3fv(colorMatrixLocation,1,false,colorConversion,0);
  for (int i=0; i < 3; i++) {
    int h=(i == 0) ? outputBuffer.height : (outputBuffer.height + 1) / 2;
    GLES20.glActiveTexture(GLES20.GL_TEXTURE0 + i);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D,yuvTextures[i]);
    GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT,1);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D,0,GLES20.GL_LUMINANCE,outputBuffer.yuvStrides[i],h,0,GLES20.GL_LUMINANCE,GLES20.GL_UNSIGNED_BYTE,outputBuffer.yuvPlanes[i]);
  }
  if (previousWidth != outputBuffer.width || previousStride != outputBuffer.yuvStrides[0]) {
    float crop=(float)outputBuffer.width / outputBuffer.yuvStrides[0];
    textureCoords=nativeFloatBuffer(0.0f,0.0f,0.0f,1.0f,crop,0.0f,crop,1.0f);
    GLES20.glVertexAttribPointer(texLocation,2,GLES20.GL_FLOAT,false,0,textureCoords);
    previousWidth=outputBuffer.width;
    previousStride=outputBuffer.yuvStrides[0];
  }
  GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
  GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP,0,4);
  checkNoGLES2Error();
}