diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-11-05 09:15:49 +0100 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-11-05 09:15:49 +0100 |
| commit | 4f370f66bbc6a96352658752c56efb1ecd6b1ed7 (patch) | |
| tree | dd9266b2153e80b7e0ea12f793e3c4dfdf27959b | |
| parent | 12d8572d439d40d030b12e8fc98210ed255405d7 (diff) | |
Fix #5887
By cherry picking unmerged fix in upstream https://github.com/nothings/stb/issues/1745.
| -rw-r--r-- | vendor/stb/src/stb_vorbis.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vendor/stb/src/stb_vorbis.c b/vendor/stb/src/stb_vorbis.c index 7e5daa367..db09fff42 100644 --- a/vendor/stb/src/stb_vorbis.c +++ b/vendor/stb/src/stb_vorbis.c @@ -1401,7 +1401,11 @@ 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) { + // Known problem upstream: https://github.com/nothings/stb/issues/1745 + // But pull request hasn't been merged: https://github.com/nothings/stb/pull/1746 + // So we cherry pick it. + // if (f->stream_start + loc >= f->stream_end || f->stream_start + loc < f->stream_start) { + if (loc >= f->stream_len) { f->stream = f->stream_end; f->eof = 1; return 0; |