summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorJames Ross-Gowan <rossymiles@gmail.com>2014-01-07 23:17:44 +1100
committerwm4 <wm4@nowhere>2014-01-27 10:04:29 +0100
commit4c83a93617528072fbdda9fc7e6159bc8a5769fc (patch)
tree76274fbb04a00d1eceddf58877c41b500d621963 /player
parentc3bcc12a3c1e7a66cdc957762b1a5f8111818a82 (diff)
downloadmpv-4c83a93617528072fbdda9fc7e6159bc8a5769fc.tar.bz2
mpv-4c83a93617528072fbdda9fc7e6159bc8a5769fc.tar.xz
w32: enable heap corruption detection
Enable the terminate-on-corruption feature. This is recommended for new Windows applications and shouldn't cause a performance hit. It actually shouldn't change anything for 64-bit builds, since Win64 has this switched on by default. See: http://blogs.msdn.com/b/michael_howard/archive/2008/02/18/faq-about-heapsetinformation-in-windows-vista-and-heap-based-buffer-overruns.aspx
Diffstat (limited to 'player')
-rw-r--r--player/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/player/main.c b/player/main.c
index 5b715d1f88..e46b3d2b0a 100644
--- a/player/main.c
+++ b/player/main.c
@@ -262,6 +262,9 @@ static void osdep_preinit(int *p_argc, char ***p_argv)
#if defined(__MINGW32__) || defined(__CYGWIN__)
// stop Windows from showing all kinds of annoying error dialogs
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
+
+ // Enable heap corruption detection
+ HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
#endif
terminal_init();