Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some minor bugs #756

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion src/libFLAC/ogg_decoder_aspect.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ FLAC__OggDecoderAspectReadStatus FLAC__ogg_decoder_aspect_skip_link(FLAC__OggDec
return FLAC__OGG_DECODER_ASPECT_READ_STATUS_LOST_SYNC;
aspect->current_linknumber--;
aspect->linkdetails[aspect->current_linknumber].is_last = true;
return FLAC__OGG_DECODER_ASPECT_READ_STATUS_OK;
return FLAC__OGG_DECODER_ASPECT_READ_STATUS_END_OF_STREAM;
}
else {
/* We can end up here for three reasons:
Expand Down
Loading