Commit 69e17d6a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: GdipGetLineGammaCorrection should check result pointer. Test added.

parent 26ccb33f
...@@ -631,7 +631,7 @@ GpStatus WINGDIPAPI GdipGetLineGammaCorrection(GpLineGradient *line, ...@@ -631,7 +631,7 @@ GpStatus WINGDIPAPI GdipGetLineGammaCorrection(GpLineGradient *line,
{ {
TRACE("(%p, %p)\n", line, usinggamma); TRACE("(%p, %p)\n", line, usinggamma);
if(!line) if(!line || !usinggamma)
return InvalidParameter; return InvalidParameter;
*usinggamma = line->gamma; *usinggamma = line->gamma;
......
...@@ -145,6 +145,30 @@ static void test_getbounds(void) ...@@ -145,6 +145,30 @@ static void test_getbounds(void)
GdipDeleteBrush((GpBrush*) brush); GdipDeleteBrush((GpBrush*) brush);
} }
static void test_getgamma(void)
{
GpStatus status;
GpLineGradient *line;
GpPointF start, end;
BOOL gamma;
start.X = start.Y = 0.0;
end.X = end.Y = 100.0;
status = GdipCreateLineBrush(&start, &end, (ARGB)0xdeadbeef, 0xdeadbeef, WrapModeTile, &line);
expect(Ok, status);
/* NULL arguments */
status = GdipGetLineGammaCorrection(NULL, NULL);
expect(InvalidParameter, status);
status = GdipGetLineGammaCorrection(line, NULL);
expect(InvalidParameter, status);
status = GdipGetLineGammaCorrection(NULL, &gamma);
expect(InvalidParameter, status);
GdipDeleteBrush((GpBrush*)line);
}
START_TEST(brush) START_TEST(brush)
{ {
struct GdiplusStartupInput gdiplusStartupInput; struct GdiplusStartupInput gdiplusStartupInput;
...@@ -162,6 +186,7 @@ START_TEST(brush) ...@@ -162,6 +186,7 @@ START_TEST(brush)
test_gradientblendcount(); test_gradientblendcount();
test_getblend(); test_getblend();
test_getbounds(); test_getbounds();
test_getgamma();
GdiplusShutdown(gdiplusToken); GdiplusShutdown(gdiplusToken);
} }
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