Skip to content

Commit

Permalink
stb_vorbis: ensure stream length in samples is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoporto committed Mar 7, 2024
1 parent 0187e9a commit fef554e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stb_vorbis.h
Original file line number Diff line number Diff line change
Expand Up @@ -5657,7 +5657,7 @@ int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float
break;
}
f->current_playback_loc += n;
if(f->current_playback_loc > lgs) {
if(f->current_playback_loc > lgs && lgs > 0 && lgs != UINT_MAX) {
int r = n - (f->current_playback_loc - lgs);
f->current_playback_loc = lgs;
return r;
Expand Down

0 comments on commit fef554e

Please sign in to comment.