Skip to content

Commit

Permalink
Fix -Wunused-result warning for ID3v1 detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmf01 committed Oct 29, 2024
1 parent fd09bbb commit 7f46eb2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/flac/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,7 @@ FLAC__bool DecoderSession_init_decoder(DecoderSession *decoder_session, const ch
return false;
}
}
fseek(f, -128, SEEK_END); /* Do not check for errors, because it could be that file is less than 128 bytes long */
fread(buffer, 1, 3, f);
if(memcmp(buffer, "TAG", 3) == 0){
if(fseek(f, -128, SEEK_END) == 0 && fread(buffer, 1, 3, f) == 3 && memcmp(buffer, "TAG", 3) == 0){
flac__utils_printf(stderr, 1, "%s: NOTE, found something that looks like an ID3v1 tag. If decoding returns an error, this ID3v1 tag is probably the cause.\n", decoder_session->inbasefilename);
}
fclose(f);
Expand Down

0 comments on commit 7f46eb2

Please sign in to comment.