Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0757ad7

Browse files
committed
test: fail length check if layer is not detected
1 parent d08b60c commit 0757ad7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

minimp3_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ static void decode_file(const char *input_file_name, const unsigned char *buf_re
394394
int len_match = ref_samples == info.samples;
395395
int relaxed_len_match = len_match || (ref_samples + 1152) == info.samples || (ref_samples + 2304) == info.samples;
396396
int seek_len_match = (ref_samples <= info.samples) || (ref_samples + 2304) >= info.samples;
397-
if ((((!relaxed_len_match && MODE_STREAM != mode && MODE_STREAM_BUF != mode && MODE_STREAM_CB != mode) || !seek_len_match) && 3 == info.layer && !no_std_vec) || (no_std_vec && !len_match))
397+
if ((((!relaxed_len_match && MODE_STREAM != mode && MODE_STREAM_BUF != mode && MODE_STREAM_CB != mode) || !seek_len_match) && (3 == info.layer || 0 == info.layer) && !no_std_vec) || (no_std_vec && !len_match))
398398
{ /* some standard vectors are for some reason a little shorter */
399399
printf("error: reference and produced number of samples do not match (%d/%d)\n", (int)ref_samples, (int)info.samples);
400400
exit(1);

0 commit comments

Comments
 (0)