Commit 75e2e9cf authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Add an exception handler to catch bad pointers passed by an application.

parent 597edc50
......@@ -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;
ret = dst_dib.funcs->convert_to( &dst_dib, &src_dib, &src->visrect );
__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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment