Skip to content

Commit f440c13

Browse files
committed
Merged revision(s) 22874 from trunk/OpenMPT:
[Fix] stb_vorbis: Fix Clang -Wtautological-compare warning and related Undefined Behaviour. Apply <nothings/stb#1746>. ........ git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@22875 56274372-70c3-4bfc-bfc3-4c3a0b034d27
1 parent da253b1 commit f440c13

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/stb_vorbis/OpenMPT.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ https://github.com/nothings/stb/blob/master/stb_vorbis.c v1.22
33
commit 5a0bb8b1c1b1ca3f4e2485f4114c1c8ea021b781 (2021-07-12)
44

55
Modifications:
6+
* <https://github.com/nothings/stb/pull/1746> has been applied.
67
* Use of alloca has been replaced with malloc, as alloca is not in C99 and
78
fails to compile.
89
* Macro redefinition of alloca with mingw-w64 has been fixed.
910
* Macro redefinition of STB_VORBIS_NO_STDIO has been fixed.
1011

1112
For building, premake is used to generate Visual Studio project files.
1213
See ../build/premake/ for details.
13-

include/stb_vorbis/stb_vorbis.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,7 @@ static int set_file_offset(stb_vorbis *f, unsigned int loc)
14101410
#endif
14111411
f->eof = 0;
14121412
if (USE_MEMORY(f)) {
1413-
if (f->stream_start + loc >= f->stream_end || f->stream_start + loc < f->stream_start) {
1413+
if (loc >= f->stream_len) {
14141414
f->stream = f->stream_end;
14151415
f->eof = 1;
14161416
return 0;

0 commit comments

Comments
 (0)