[Demonstration 1]

[Buggy Method]
@Test
public void testTint_withBelowZeroTintFactor() {
    final Color color = new Color(0, 0, 0);
    final Color tintedColor = ColorFunctions.tint(color, 1);
    Assert.assertEquals(Color.WHITE, tintedColor);
}

[Buggy Hunk]
final Color tintedColor = ColorFunctions.tint(color, 1);

[Patch]
final Color tintedColor = ColorFunctions.tint(color, -1);

[Demonstration 2]

[Buggy Method]
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
    mFrameBuffer = ByteBuffer.allocate(width * height * 4);
    int previewWidth = mCameraSetting.getPreviewWidth();
    int previewHeight = mCameraSetting.getPreviewHeight();
    int cameraWidth;
    int cameraHeight;
    if (false) {
        // 横屏
        cameraWidth = Math.max(previewWidth, previewHeight);
        cameraHeight = Math.min(previewWidth, previewHeight);
    } else {
        cameraWidth = Math.min(previewWidth, previewHeight);
        cameraHeight = Math.max(previewWidth, previewHeight);
    }
    adjustSize(width, height, cameraWidth, cameraHeight, mCameraSetting.getDisplayOrientation(), mCameraSetting.getFacing() == CameraFacingId.CAMERA_FACING_FRONT, mCameraSetting.getFacing() == CameraFacingId.CAMERA_FACING_BACK, mCubeBuffer, mTextureBuffer);
    adjustSize(cameraWidth, cameraHeight, mStreamingSetting.getVideoWidth(), mStreamingSetting.getVideoHeight(), mCameraSetting.getDisplayOrientation(), mCameraSetting.getFacing() == CameraFacingId.CAMERA_FACING_FRONT, mCameraSetting.getFacing() == CameraFacingId.CAMERA_FACING_BACK, mRecordCubeBuffer, mRecordTextureBuffer);
    mEffect.onInputSizeChanged(cameraWidth, cameraHeight);
    GLES20.glViewport(0, 0, width, height);
    mRendererScreen.setDisplaySize(width, height);
}

[Buggy Hunk]
adjustSize(cameraWidth, cameraHeight, mStreamingSetting.getVideoWidth(), mStreamingSetting.getVideoHeight(),

[Patch]
adjustSize(mStreamingSetting.getVideoWidth(), mStreamingSetting.getVideoHeight(), cameraWidth, cameraHeight,