mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 14:24:45 +00:00
gdi32: Add an exception handler to catch bad pointers passed by an application.
This commit is contained in:
parent
597edc503f
commit
75e2e9cf3f
1 changed files with 11 additions and 1 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "gdi_private.h"
|
||||
#include "dibdrv.h"
|
||||
|
||||
#include "wine/exception.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dib);
|
||||
|
@ -272,7 +273,16 @@ DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bit
|
|||
if ( !init_dib_info_from_bitmapinfo( &dst_dib, dst_info, dst_bits, 0 ) )
|
||||
return ERROR_BAD_FORMAT;
|
||||
|
||||
__TRY
|
||||
{
|
||||
ret = dst_dib.funcs->convert_to( &dst_dib, &src_dib, &src->visrect );
|
||||
}
|
||||
__EXCEPT_PAGE_FAULT
|
||||
{
|
||||
WARN( "invalid bits pointer %p\n", src_bits );
|
||||
ret = FALSE;
|
||||
}
|
||||
__ENDTRY
|
||||
|
||||
/* We shared the color tables, so there's no need to free the dib_infos here */
|
||||
if(!ret) return ERROR_BAD_FORMAT;
|
||||
|
|
Loading…
Reference in a new issue