@Test
public void checkAndReadFrameHeader_invalidData_isFalse() throws Exception {

  FlacStreamMetadataHolder streamMetadataHolder =
      new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
  ExtractorInput input =
      buildExtractorInputReadingFromFirstFrame(
          "flac/bear_one_metadata_block.flac", streamMetadataHolder);
  ParsableByteArray scratch = new ParsableByteArray(FlacConstants.MAX_FRAME_HEADER_SIZE);
  input.read(scratch.data, 0, FlacConstants.MAX_FRAME_HEADER_SIZE);
  // The first bytes of the frame are not equal to the frame start marker.
  boolean result =
      FlacFrameReader.checkAndReadFrameHeader(
          scratch,
          streamMetadataHolder.flacStreamMetadata,
          /* frameStartMarker= */ -1,
          new SampleNumberHolder());
  assertThat(result).isFalse();
}