From: <sv...@op...> - 2025-02-15 15:43:24
|
Author: manx Date: Sat Feb 15 16:43:10 2025 New Revision: 22874 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22874 Log: [Fix] stb_vorbis: Fix Clang -Wtautological-compare warning and related Undefined Behaviour. Apply <https://github.com/nothings/stb/pull/1746>. Modified: trunk/OpenMPT/include/stb_vorbis/OpenMPT.txt trunk/OpenMPT/include/stb_vorbis/stb_vorbis.c Modified: trunk/OpenMPT/include/stb_vorbis/OpenMPT.txt ============================================================================== --- trunk/OpenMPT/include/stb_vorbis/OpenMPT.txt Sat Feb 15 16:40:42 2025 (r22873) +++ trunk/OpenMPT/include/stb_vorbis/OpenMPT.txt Sat Feb 15 16:43:10 2025 (r22874) @@ -3,6 +3,7 @@ commit 5a0bb8b1c1b1ca3f4e2485f4114c1c8ea021b781 (2021-07-12) Modifications: + * <https://github.com/nothings/stb/pull/1746> has been applied. * Use of alloca has been replaced with malloc, as alloca is not in C99 and fails to compile. * Macro redefinition of alloca with mingw-w64 has been fixed. @@ -10,4 +11,3 @@ For building, premake is used to generate Visual Studio project files. See ../build/premake/ for details. - Modified: trunk/OpenMPT/include/stb_vorbis/stb_vorbis.c ============================================================================== --- trunk/OpenMPT/include/stb_vorbis/stb_vorbis.c Sat Feb 15 16:40:42 2025 (r22873) +++ trunk/OpenMPT/include/stb_vorbis/stb_vorbis.c Sat Feb 15 16:43:10 2025 (r22874) @@ -1410,7 +1410,7 @@ #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_len) { f->stream = f->stream_end; f->eof = 1; return 0; |