Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
external libs: rebuilt libmodplug after some updates :
- load_med.cpp: fix an old incorrect logic in boundary check. from: libmodplug oob_read_fixes branch commit 187d2da725d4 - load_abc.cpp: don't increment p unless its non null from: libmodplug oob_read_fixes branch commit 6339dfccee2f - a few _MSC_VER ifdef corrections from: libmodplug github PR/45 - changed several 'MSC_VER' checks into '_MSC_VER && _M_IX86' checks they are supposed to be guarding Visual Studio inline IX86 asm code from: libmodplug github PR/45
- Loading branch information
Showing
20 changed files
with
339 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,304 @@ | ||
- load_med.cpp: fix an old incorrect logic in boundary check. | ||
from: libmodplug oob_read_fixes branch commit 187d2da725d4 | ||
- load_abc.cpp: don't increment p unless its non null | ||
from: libmodplug oob_read_fixes branch commit 6339dfccee2f | ||
- a few _MSC_VER ifdef corrections | ||
from: libmodplug github PR/45 | ||
- changed several 'MSC_VER' checks into '_MSC_VER && _M_IX86' checks | ||
they are supposed to be guarding Visual Studio inline IX86 asm code | ||
from: libmodplug github PR/45 | ||
|
||
diff --git a/external/libmodplug-0.8.9.0/src/fastmix.cpp b/external/libmodplug-0.8.9.0/src/fastmix.cpp | ||
--- a/external/libmodplug-0.8.9.0/src/fastmix.cpp | ||
+++ b/external/libmodplug-0.8.9.0/src/fastmix.cpp | ||
@@ -9,7 +9,7 @@ | ||
#include "sndfile.h" | ||
#include <math.h> | ||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
#pragma bss_seg(".modplug") | ||
#endif | ||
|
||
@@ -27,7 +27,7 @@ | ||
float MixFloatBuffer[MIXBUFFERSIZE*2]; | ||
#endif | ||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
#pragma bss_seg() | ||
#endif | ||
|
||
@@ -1611,7 +1611,7 @@ | ||
#endif | ||
|
||
// Clip and convert to 8 bit | ||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
__declspec(naked) DWORD MPPASMCALL X86_Convert32To8(LPVOID lp16, int *pBuffer, DWORD lSampleCount, LPLONG lpMin, LPLONG lpMax) | ||
//------------------------------------------------------------------------------ | ||
{ | ||
@@ -1701,7 +1701,7 @@ | ||
#endif //MSC_VER, else | ||
|
||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
// Clip and convert to 16 bit | ||
__declspec(naked) DWORD MPPASMCALL X86_Convert32To16(LPVOID lp16, int *pBuffer, DWORD lSampleCount, LPLONG lpMin, LPLONG lpMax) | ||
//------------------------------------------------------------------------------ | ||
@@ -1794,7 +1794,7 @@ | ||
} | ||
#endif //MSC_VER, else | ||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
// Clip and convert to 24 bit | ||
__declspec(naked) DWORD MPPASMCALL X86_Convert32To24(LPVOID lp16, int *pBuffer, DWORD lSampleCount, LPLONG lpMin, LPLONG lpMax) | ||
//------------------------------------------------------------------------------ | ||
@@ -1902,7 +1902,7 @@ | ||
} | ||
#endif | ||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
// Clip and convert to 32 bit | ||
__declspec(naked) DWORD MPPASMCALL X86_Convert32To32(LPVOID lp16, int *pBuffer, DWORD lSampleCount, LPLONG lpMin, LPLONG lpMax) | ||
//------------------------------------------------------------------------------ | ||
@@ -1992,7 +1992,7 @@ | ||
#endif | ||
|
||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
void MPPASMCALL X86_InitMixBuffer(int *pBuffer, UINT nSamples) | ||
//------------------------------------------------------------ | ||
{ | ||
@@ -2034,7 +2034,7 @@ | ||
#endif | ||
|
||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
__declspec(naked) void MPPASMCALL X86_InterleaveFrontRear(int *pFrontBuf, int *pRearBuf, DWORD nSamples) | ||
//------------------------------------------------------------------------------ | ||
{ | ||
@@ -2079,7 +2079,7 @@ | ||
#endif | ||
|
||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
VOID MPPASMCALL X86_MonoFromStereo(int *pMixBuf, UINT nSamples) | ||
//------------------------------------------------------------- | ||
{ | ||
@@ -2116,7 +2116,7 @@ | ||
#define OFSDECAYMASK 0xFF | ||
|
||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
void MPPASMCALL X86_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs) | ||
//------------------------------------------------------------------------------ | ||
{ | ||
@@ -2217,7 +2217,7 @@ | ||
} | ||
#endif | ||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
void MPPASMCALL X86_EndChannelOfs(MODCHANNEL *pChannel, int *pBuffer, UINT nSamples) | ||
//------------------------------------------------------------------------------ | ||
{ | ||
@@ -2291,7 +2291,7 @@ | ||
#define MIXING_LIMITMAX (0x08100000) | ||
#define MIXING_LIMITMIN (-MIXING_LIMITMAX) | ||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
__declspec(naked) UINT MPPASMCALL X86_AGC(int *pBuffer, UINT nSamples, UINT nAGC) | ||
//------------------------------------------------------------------------------ | ||
{ | ||
@@ -2327,7 +2327,6 @@ | ||
jmp agcrecover | ||
} | ||
} | ||
- | ||
#pragma warning (default:4100) | ||
#else | ||
// Version for GCC | ||
@@ -2378,11 +2377,9 @@ | ||
} | ||
|
||
|
||
- | ||
void CSoundFile::ResetAGC() | ||
//------------------------- | ||
{ | ||
gnAGC = AGC_UNITY; | ||
} | ||
- | ||
#endif // NO_AGC | ||
diff --git a/external/libmodplug-0.8.9.0/src/libmodplug/sndfile.h b/external/libmodplug-0.8.9.0/src/libmodplug/sndfile.h | ||
--- a/external/libmodplug-0.8.9.0/src/libmodplug/sndfile.h | ||
+++ b/external/libmodplug-0.8.9.0/src/libmodplug/sndfile.h | ||
@@ -952,7 +952,7 @@ | ||
#define AGC_UNITY (1 << AGC_PRECISION) | ||
|
||
// Calling conventions | ||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
#define MPPASMCALL __cdecl | ||
#define MPPFASTCALL __fastcall | ||
#else | ||
diff --git a/external/libmodplug-0.8.9.0/src/libmodplug/stdafx.h b/external/libmodplug-0.8.9.0/src/libmodplug/stdafx.h | ||
--- a/external/libmodplug-0.8.9.0/src/libmodplug/stdafx.h | ||
+++ b/external/libmodplug-0.8.9.0/src/libmodplug/stdafx.h | ||
@@ -33,7 +33,7 @@ | ||
|
||
#ifdef _WIN32 | ||
|
||
-#ifdef MSC_VER | ||
+#ifdef _MSC_VER | ||
#pragma warning (disable:4201) | ||
#pragma warning (disable:4514) | ||
#endif | ||
diff --git a/external/libmodplug-0.8.9.0/src/load_abc.cpp b/external/libmodplug-0.8.9.0/src/load_abc.cpp | ||
--- a/external/libmodplug-0.8.9.0/src/load_abc.cpp | ||
+++ b/external/libmodplug-0.8.9.0/src/load_abc.cpp | ||
@@ -1476,7 +1476,7 @@ | ||
d[chordnote] = i; | ||
break; | ||
} | ||
- p++; | ||
+ if (*p) p++; | ||
switch(*p) { | ||
case 'b': | ||
d[chordnote]--; | ||
@@ -1498,7 +1498,7 @@ | ||
d[chordbase] = i; | ||
break; | ||
} | ||
- p++; | ||
+ if (*p) p++; | ||
switch(*p) { | ||
case 'b': | ||
d[chordbase]--; | ||
diff --git a/external/libmodplug-0.8.9.0/src/load_med.cpp b/external/libmodplug-0.8.9.0/src/load_med.cpp | ||
--- a/external/libmodplug-0.8.9.0/src/load_med.cpp | ||
+++ b/external/libmodplug-0.8.9.0/src/load_med.cpp | ||
@@ -876,7 +876,7 @@ | ||
{ | ||
DWORD nameofs = bswapBE32(pbi->blockname); | ||
UINT namelen = bswapBE32(pbi->blocknamelen); | ||
- if ((nameofs < dwMemLength) && (namelen < dwMemLength + nameofs)) | ||
+ if ((nameofs < dwMemLength) && (namelen < dwMemLength - nameofs)) | ||
{ | ||
SetPatternName(iBlk, (LPCSTR)(lpStream+nameofs)); | ||
} | ||
diff --git a/external/libmodplug-0.8.9.0/src/load_xm.cpp b/external/libmodplug-0.8.9.0/src/load_xm.cpp | ||
--- a/external/libmodplug-0.8.9.0/src/load_xm.cpp | ||
+++ b/external/libmodplug-0.8.9.0/src/load_xm.cpp | ||
@@ -11,7 +11,7 @@ | ||
//////////////////////////////////////////////////////// | ||
// FastTracker II XM file support | ||
|
||
-#ifdef MSC_VER | ||
+#ifdef _MSC_VER | ||
#pragma warning(disable:4244) | ||
#endif | ||
|
||
diff --git a/external/libmodplug-0.8.9.0/src/snd_flt.cpp b/external/libmodplug-0.8.9.0/src/snd_flt.cpp | ||
--- a/external/libmodplug-0.8.9.0/src/snd_flt.cpp | ||
+++ b/external/libmodplug-0.8.9.0/src/snd_flt.cpp | ||
@@ -13,12 +13,11 @@ | ||
|
||
#ifndef NO_FILTER | ||
|
||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
#define _ASM_MATH | ||
#endif | ||
|
||
#ifdef _ASM_MATH | ||
- | ||
// pow(a,b) returns a^^b -> 2^^(b.log2(a)) | ||
static float pow(float a, float b) | ||
{ | ||
@@ -42,7 +41,6 @@ | ||
return result; | ||
} | ||
|
||
- | ||
#else | ||
|
||
#include <math.h> | ||
diff --git a/external/libmodplug-0.8.9.0/src/snd_fx.cpp b/external/libmodplug-0.8.9.0/src/snd_fx.cpp | ||
--- a/external/libmodplug-0.8.9.0/src/snd_fx.cpp | ||
+++ b/external/libmodplug-0.8.9.0/src/snd_fx.cpp | ||
@@ -9,7 +9,7 @@ | ||
#include "sndfile.h" | ||
#include "tables.h" | ||
|
||
-#ifdef MSC_VER | ||
+#ifdef _MSC_VER | ||
#pragma warning(disable:4244) | ||
#endif | ||
|
||
diff --git a/external/libmodplug-0.8.9.0/src/sndfile.cpp b/external/libmodplug-0.8.9.0/src/sndfile.cpp | ||
--- a/external/libmodplug-0.8.9.0/src/sndfile.cpp | ||
+++ b/external/libmodplug-0.8.9.0/src/sndfile.cpp | ||
@@ -1661,8 +1661,7 @@ | ||
DWORD CSoundFile::TransposeToFrequency(int transp, int ftune) | ||
//----------------------------------------------------------- | ||
{ | ||
- | ||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
const float _fbase = 8363; | ||
const float _factor = 1.0f/(12.0f*128.0f); | ||
int result; | ||
@@ -1702,8 +1701,7 @@ | ||
int CSoundFile::FrequencyToTranspose(DWORD freq) | ||
//---------------------------------------------- | ||
{ | ||
- | ||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
const float _f1_8363 = 1.0f / 8363.0f; | ||
const float _factor = 128 * 12; | ||
LONG result; | ||
diff --git a/external/libmodplug-0.8.9.0/src/sndmix.cpp b/external/libmodplug-0.8.9.0/src/sndmix.cpp | ||
--- a/external/libmodplug-0.8.9.0/src/sndmix.cpp | ||
+++ b/external/libmodplug-0.8.9.0/src/sndmix.cpp | ||
@@ -80,7 +80,7 @@ | ||
// Return (a*b)/c - no divide error | ||
int _muldiv(long a, long b, long c) | ||
{ | ||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
int sign, result; | ||
_asm { | ||
mov eax, a | ||
@@ -123,11 +123,10 @@ | ||
#endif | ||
} | ||
|
||
- | ||
// Return (a*b+c/2)/c - no divide error | ||
int _muldivr(long a, long b, long c) | ||
{ | ||
-#ifdef MSC_VER | ||
+#if defined(_MSC_VER) && defined(_M_IX86) | ||
int sign, result; | ||
_asm { | ||
mov eax, a | ||
@@ -340,7 +339,6 @@ | ||
} | ||
|
||
|
||
- | ||
///////////////////////////////////////////////////////////////////////////// | ||
// Handles navigation/effects | ||
|
||
|
Oops, something went wrong.