From 2c08a980e89fef9414cb767a69926ad00a16db51 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 15 Jan 2017 19:18:02 +0100 Subject: [PATCH] Added patch to check if any 16 bit thunks have been allocated before accessing pointer. --- ...if-any-16-bit-thunks-have-been-alloc.patch | 27 +++++++++++++++++++ patches/msvideo16-HasThunk/definition | 1 + patches/patchinstall.sh | 19 +++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 patches/msvideo16-HasThunk/0001-msvideo16-Check-if-any-16-bit-thunks-have-been-alloc.patch create mode 100644 patches/msvideo16-HasThunk/definition diff --git a/patches/msvideo16-HasThunk/0001-msvideo16-Check-if-any-16-bit-thunks-have-been-alloc.patch b/patches/msvideo16-HasThunk/0001-msvideo16-Check-if-any-16-bit-thunks-have-been-alloc.patch new file mode 100644 index 00000000..563cb315 --- /dev/null +++ b/patches/msvideo16-HasThunk/0001-msvideo16-Check-if-any-16-bit-thunks-have-been-alloc.patch @@ -0,0 +1,27 @@ +From d386a3724eac666427f7f176e7209f74e1b98885 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +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 + diff --git a/patches/msvideo16-HasThunk/definition b/patches/msvideo16-HasThunk/definition new file mode 100644 index 00000000..bf483d1b --- /dev/null +++ b/patches/msvideo16-HasThunk/definition @@ -0,0 +1 @@ +Fixes: [41448] Check if any 16 bit thunks have been allocated before accessing pointer diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 59896092..4d6e8473 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -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: