Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
deb1f047
Commit
deb1f047
authored
Jul 11, 2014
by
Qian Hong
Committed by
Alexandre Julliard
Jul 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Set outer pointer to NULL when image loading functions fail.
parent
b4acc62e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
image.c
dlls/gdiplus/image.c
+4
-0
image.c
dlls/gdiplus/tests/image.c
+27
-3
No files found.
dlls/gdiplus/image.c
View file @
deb1f047
...
...
@@ -1387,6 +1387,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename,
if
(
!
filename
||
!
bitmap
)
return
InvalidParameter
;
*
bitmap
=
NULL
;
stat
=
GdipCreateStreamOnFile
(
filename
,
GENERIC_READ
,
&
stream
);
if
(
stat
!=
Ok
)
...
...
@@ -2945,6 +2947,8 @@ GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR* filename,
if
(
!
filename
||
!
image
)
return
InvalidParameter
;
*
image
=
NULL
;
stat
=
GdipCreateStreamOnFile
(
filename
,
GENERIC_READ
,
&
stream
);
if
(
stat
!=
Ok
)
...
...
dlls/gdiplus/tests/image.c
View file @
deb1f047
...
...
@@ -374,24 +374,48 @@ static void test_GdipImageGetFrameDimensionsCount(void)
static
void
test_LoadingImages
(
void
)
{
GpStatus
stat
;
GpBitmap
*
bm
;
GpImage
*
img
;
static
const
WCHAR
nonexistentW
[]
=
{
'n'
,
'o'
,
'n'
,
'e'
,
'x'
,
'i'
,
's'
,
't'
,
'e'
,
'n'
,
't'
,
0
};
stat
=
GdipCreateBitmapFromFile
(
0
,
0
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipCreateBitmapFromFile
(
0
,
(
GpBitmap
**
)
0xdeadbeef
);
bm
=
(
GpBitmap
*
)
0xdeadbeef
;
stat
=
GdipCreateBitmapFromFile
(
0
,
&
bm
);
expect
(
InvalidParameter
,
stat
);
ok
(
bm
==
(
GpBitmap
*
)
0xdeadbeef
,
"returned %p
\n
"
,
bm
);
bm
=
(
GpBitmap
*
)
0xdeadbeef
;
stat
=
GdipCreateBitmapFromFile
(
nonexistentW
,
&
bm
);
todo_wine
expect
(
InvalidParameter
,
stat
);
ok
(
!
bm
,
"returned %p
\n
"
,
bm
);
stat
=
GdipLoadImageFromFile
(
0
,
0
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipLoadImageFromFile
(
0
,
(
GpImage
**
)
0xdeadbeef
);
img
=
(
GpImage
*
)
0xdeadbeef
;
stat
=
GdipLoadImageFromFile
(
0
,
&
img
);
expect
(
InvalidParameter
,
stat
);
ok
(
img
==
(
GpImage
*
)
0xdeadbeef
,
"returned %p
\n
"
,
img
);
img
=
(
GpImage
*
)
0xdeadbeef
;
stat
=
GdipLoadImageFromFile
(
nonexistentW
,
&
img
);
todo_wine
expect
(
OutOfMemory
,
stat
);
ok
(
!
img
,
"returned %p
\n
"
,
img
);
stat
=
GdipLoadImageFromFileICM
(
0
,
0
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipLoadImageFromFileICM
(
0
,
(
GpImage
**
)
0xdeadbeef
);
img
=
(
GpImage
*
)
0xdeadbeef
;
stat
=
GdipLoadImageFromFileICM
(
0
,
&
img
);
expect
(
InvalidParameter
,
stat
);
ok
(
img
==
(
GpImage
*
)
0xdeadbeef
,
"returned %p
\n
"
,
img
);
img
=
(
GpImage
*
)
0xdeadbeef
;
stat
=
GdipLoadImageFromFileICM
(
nonexistentW
,
&
img
);
todo_wine
expect
(
OutOfMemory
,
stat
);
ok
(
!
img
,
"returned %p
\n
"
,
img
);
}
static
void
test_SavingImages
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment