Branch Coverage

src/wavpack.c
Criterion Covered Total %
branch 85 130 65.3


line true false branch
54 11 8 while (!done) {
55 0 11 if ( !_check_buf(infile, wvp->buf, 32, WAVPACK_BLOCK_SIZE) ) {
63 2 9 if ( bptr[0] == 'R' ) {
64 0 2 if ( !_wavpack_parse_old(wvp) ) {
73 30610 119 while ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
109 10 while ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
1 9 while ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
0 9 while ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
78 7 30713 if ( !buffer_len(wvp->buf) ) {
79 0 7 if ( !_check_buf(infile, wvp->buf, 32, WAVPACK_BLOCK_SIZE) ) {
89 8 1 if ( _wavpack_parse_block(wvp) ) {
114 9 0 if ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
9 0 if ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
9 0 if ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
0 9 if ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
146 0 9 if (wvp->header->version < 0x4) {
156 2 7 my_hv_store( wvp->info, (wvp->header->flags & 0x8) ? "hybrid" : "lossless", newSVuv(1) );
2 7 my_hv_store( wvp->info, (wvp->header->flags & 0x8) ? "hybrid" : "lossless", newSVuv(1) );
161 8 1 if ( samplerate_index < 0xF ) {
171 0 9 my_hv_store( wvp->info, "channels", newSVuv( (wvp->header->flags & 0x4) ? 1 : 2 ) );
177 1 8 if ( !wvp->header->block_samples ) {
183 53 1 while (remaining > 0) {
190 0 53 if ( !_check_buf(wvp->infile, wvp->buf, 4, WAVPACK_BLOCK_SIZE) ) {
198 7 46 if (id & ID_LARGE) {
211 13 40 if (id & ID_ODD_SIZE) {
217 47 6 if ( id == ID_WV_BITSTREAM || !size ) {
46 1 if ( id == ID_WV_BITSTREAM || !size ) {
249 13 33 if (size & 0x1) {
250 13 0 if ( buffer_len(wvp->buf) ) {
262 8 0 if ( wvp->header->total_samples && wvp->file_size > 0 ) {
8 0 if ( wvp->header->total_samples && wvp->file_size > 0 ) {
264 8 0 if (samplerate != NULL) {
267 1 7 if (wvp->header->flags & 0x80000000)
270 8 0 song_length_ms = ((wvp->header->total_samples * 1.0) / SvIV(*samplerate)) * 1000;
297 0 1 if (size == 6) {
314 1 0 if (wvp->header->flags & 0x80000000) {
318 1 0 if (samplerate_index < 0xF)
335 45 0 if ( buffer_len(wvp->buf) >= size ) {
367 0 2 if ( strncmp( (char *)buffer_ptr(wvp->buf), "RIFF", 4 ) ) {
378 0 2 if ( strncmp( (char *)buffer_ptr(wvp->buf), "WAVE", 4 ) ) {
389 0 2 if ( !_check_buf(wvp->infile, wvp->buf, 8, WAVPACK_BLOCK_SIZE) ) {
395 4 0 while ( buffer_len(wvp->buf) >= 8 ) {
405 0 4 if ( chunk_size % 2 ) {
411 2 2 if ( !strcmp( chunk_id, "data" ) ) {
417 2 0 if ( !strcmp( chunk_id, "fmt " ) ) {
418 0 2 if ( !_check_buf(wvp->infile, wvp->buf, chunk_size, WAV_BLOCK_SIZE) ) {
423 0 2 if (chunk_size < sizeof(wavhdr)) {
437 0 2 if (chunk_size > 16) {
447 0 2 if ( !_check_buf(wvp->infile, wvp->buf, 8, WAVPACK_BLOCK_SIZE) ) {
454 2 0 if (
455 2 0 wavhdr.FormatTag != 1 || !wavhdr.NumChannels || wavhdr.NumChannels > 2 ||
2 0 wavhdr.FormatTag != 1 || !wavhdr.NumChannels || wavhdr.NumChannels > 2 ||
2 0 wavhdr.FormatTag != 1 || !wavhdr.NumChannels || wavhdr.NumChannels > 2 ||
456 2 0 !wavhdr.SampleRate || wavhdr.BitsPerSample < 16 || wavhdr.BitsPerSample > 24 ||
2 0 !wavhdr.SampleRate || wavhdr.BitsPerSample < 16 || wavhdr.BitsPerSample > 24 ||
2 0 !wavhdr.SampleRate || wavhdr.BitsPerSample < 16 || wavhdr.BitsPerSample > 24 ||
457 2 0 wavhdr.BlockAlign / wavhdr.NumChannels > 3 || wavhdr.BlockAlign % wavhdr.NumChannels ||
0 2 wavhdr.BlockAlign / wavhdr.NumChannels > 3 || wavhdr.BlockAlign % wavhdr.NumChannels ||
465 0 2 total_samples = chunk_size / wavhdr.NumChannels / ((wavhdr.BitsPerSample > 16) ? 3 : 2);
469 2 0 if ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
2 0 if ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
2 0 if ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
0 2 if ( bptr[0] != 'w' || bptr[1] != 'v' || bptr[2] != 'p' || bptr[3] != 'k' ) {
480 2 0 if (wphdr.version >= 2) {
484 1 1 if (wphdr.version == 3) {