Mike Hearn : gdi: Protect GetEnhMetaFilePaletteEntries against bad handles.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 7 13:30:54 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 8122173abf0e8de34e87d10c549e1e1a7a16f896
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=8122173abf0e8de34e87d10c549e1e1a7a16f896

Author: Mike Hearn <mike at plan99.net>
Date:   Fri Apr  7 17:37:06 2006 +0100

gdi: Protect GetEnhMetaFilePaletteEntries against bad handles.

---

 dlls/gdi/enhmetafile.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi/enhmetafile.c b/dlls/gdi/enhmetafile.c
index 8725f9b..7ac6a40 100644
--- a/dlls/gdi/enhmetafile.c
+++ b/dlls/gdi/enhmetafile.c
@@ -2571,6 +2571,8 @@ UINT WINAPI GetEnhMetaFilePaletteEntries
 
   TRACE( "(%p,%d,%p)\n", hEmf, cEntries, lpPe );
 
+  if (!enhHeader) return 0;
+
   /* First check if there are any palettes associated with
      this metafile. */
   if ( enhHeader->nPalEntries == 0 ) return 0;




More information about the wine-cvs mailing list