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

Resolve gcc warnings in stb_vorbis #1657

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion stb_vorbis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ static int set_file_offset(stb_vorbis *f, unsigned int loc)
#endif
f->eof = 0;
if (USE_MEMORY(f)) {
if (f->stream_start + loc >= f->stream_end || f->stream_start + loc < f->stream_start) {
if (loc >= f->stream_end - f->stream_start) {
f->stream = f->stream_end;
f->eof = 1;
return 0;
Expand Down Expand Up @@ -4704,6 +4704,9 @@ static int seek_to_sample_coarse(stb_vorbis *f, uint32 sample_number)
uint32 delta, stream_length, padding, last_sample_limit;
double offset = 0.0, bytes_per_sample = 0.0;
int probe = 0;
mid.last_decoded_sample =-1;
mid.page_end =-1;
mid.page_start =-1;

// find the last page and validate the target sample
stream_length = stb_vorbis_stream_length_in_samples(f);
Expand Down