gdiplus: Avoid dereferencing a potential NULL (Coverity 589).

oldstable
Aric Stewart 2008-10-16 09:09:49 -05:00 committed by Alexandre Julliard
parent 8ed05aeb32
commit c4e859a678
1 changed files with 3 additions and 1 deletions

View File

@ -450,7 +450,9 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
TRACE("%d %d %d %d %p %p\n", width, height, stride, format, scan0, bitmap);
if(!bitmap || width <= 0 || height <= 0 || (scan0 && (stride % 4))){
if (!bitmap) return InvalidParameter;
if(width <= 0 || height <= 0 || (scan0 && (stride % 4))){
*bitmap = NULL;
return InvalidParameter;
}