Module: wine Branch: master Commit: c4e859a678db1440e1357c42f60e620716e383f8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c4e859a678db1440e1357c42f6...
Author: Aric Stewart aric@codeweavers.com Date: Thu Oct 16 09:09:49 2008 -0500
gdiplus: Avoid dereferencing a potential NULL (Coverity 589).
---
dlls/gdiplus/image.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 9516d64..ffd270b 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -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; }