Added patch to check if any 16 bit thunks have been allocated before accessing pointer.

This commit is contained in:
Sebastian Lackner 2017-01-15 19:18:02 +01:00
parent 9686fe6647
commit 2c08a980e8
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,27 @@
From d386a3724eac666427f7f176e7209f74e1b98885 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 15 Jan 2017 18:59:10 +0100
Subject: msvideo16: Check if any 16 bit thunks have been allocated before
accessing pointer.
---
dlls/msvideo.dll16/msvideo16.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/msvideo.dll16/msvideo16.c b/dlls/msvideo.dll16/msvideo16.c
index 8f02cc1ebc8..5a3b8aa74ee 100644
--- a/dlls/msvideo.dll16/msvideo16.c
+++ b/dlls/msvideo.dll16/msvideo16.c
@@ -762,6 +762,9 @@ static struct msvideo_thunk* MSVIDEO_HasThunk(HIC16 hic)
{
struct msvideo_thunk* thunk;
+ if (!MSVIDEO_Thunks)
+ return NULL;
+
for (thunk = MSVIDEO_Thunks; thunk < &MSVIDEO_Thunks[MAX_THUNKS]; thunk++)
{
if (thunk->hIC16 == hic) return thunk;
--
2.11.0

View File

@ -0,0 +1 @@
Fixes: [41448] Check if any 16 bit thunks have been allocated before accessing pointer

View File

@ -212,6 +212,7 @@ patch_enable_all ()
enable_msvcrt_Math_Precision="$1"
enable_msvfw32_ICGetDisplayFormat="$1"
enable_msvideo_dll16_DrawDibProfileDisplay="$1"
enable_msvideo16_HasThunk="$1"
enable_msxml3_AllowXsltScript="$1"
enable_ntdll_APC_Performance="$1"
enable_ntdll_APC_Start_Process="$1"
@ -846,6 +847,9 @@ patch_enable ()
msvideo.dll16-DrawDibProfileDisplay)
enable_msvideo_dll16_DrawDibProfileDisplay="$2"
;;
msvideo16-HasThunk)
enable_msvideo16_HasThunk="$2"
;;
msxml3-AllowXsltScript)
enable_msxml3_AllowXsltScript="$2"
;;
@ -5181,6 +5185,21 @@ if test "$enable_msvideo_dll16_DrawDibProfileDisplay" -eq 1; then
) >> "$patchlist"
fi
# Patchset msvideo16-HasThunk
# |
# | This patchset fixes the following Wine bugs:
# | * [#41448] Check if any 16 bit thunks have been allocated before accessing pointer
# |
# | Modified files:
# | * dlls/msvideo.dll16/msvideo16.c
# |
if test "$enable_msvideo16_HasThunk" -eq 1; then
patch_apply msvideo16-HasThunk/0001-msvideo16-Check-if-any-16-bit-thunks-have-been-alloc.patch
(
echo '+ { "Michael Müller", "msvideo16: Check if any 16 bit thunks have been allocated before accessing pointer.", 1 },';
) >> "$patchlist"
fi
# Patchset msxml3-AllowXsltScript
# |
# | This patchset fixes the following Wine bugs: