Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b48a37f4
Commit
b48a37f4
authored
Jul 11, 2023
by
Jeff Smith
Committed by
Alexandre Julliard
Jul 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix GdipGetAllPropertyItems return value when no properties exist.
Discovered in researching
https://bugs.winehq.org/show_bug.cgi?id=54748
parent
1517342f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
27 deletions
+27
-27
image.c
dlls/gdiplus/image.c
+1
-1
image.c
dlls/gdiplus/tests/image.c
+26
-26
No files found.
dlls/gdiplus/image.c
View file @
b48a37f4
...
...
@@ -2846,7 +2846,7 @@ GpStatus WINGDIPAPI GdipGetAllPropertyItems(GpImage *image, UINT size,
}
reader
=
((
GpBitmap
*
)
image
)
->
metadata_reader
;
if
(
!
reader
)
return
PropertyNotFound
;
if
(
!
reader
)
return
GenericError
;
hr
=
IWICMetadataReader_GetEnumerator
(
reader
,
&
enumerator
);
if
(
FAILED
(
hr
))
return
hresult_to_status
(
hr
);
...
...
dlls/gdiplus/tests/image.c
View file @
b48a37f4
...
...
@@ -3681,6 +3681,7 @@ static void test_image_properties(void)
};
GpStatus
status
,
expected
;
GpImage
*
image
;
PropertyItem
*
prop_item
;
UINT
prop_count
,
prop_size
,
i
;
PROPID
prop_id
[
16
]
=
{
0
};
ImageType
image_type
;
...
...
@@ -3816,6 +3817,31 @@ static void test_image_properties(void)
status
=
GdipGetPropertySize
(
image
,
&
prop_size
,
&
prop_count
);
expect
(
expected
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
0
,
0
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
prop_count
,
NULL
);
expect
(
InvalidParameter
,
status
);
prop_item
=
HeapAlloc
(
GetProcessHeap
(),
0
,
prop_size
);
expected
=
(
image_type
==
ImageTypeMetafile
)
?
NotImplemented
:
InvalidParameter
;
if
(
prop_count
!=
1
)
{
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
1
,
prop_item
);
expect
(
expected
,
status
);
}
if
(
prop_size
!=
0
)
{
status
=
GdipGetAllPropertyItems
(
image
,
0
,
prop_count
,
prop_item
);
expect
(
expected
,
status
);
}
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
+
1
,
prop_count
,
prop_item
);
expect
(
expected
,
status
);
if
(
image_type
!=
ImageTypeMetafile
)
expected
=
(
prop_count
==
0
)
?
GenericError
:
Ok
;
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
prop_count
,
prop_item
);
ok
(
status
==
expected
||
broken
(
status
==
Ok
&&
prop_count
==
0
),
/* XP */
"Expected %d, got %d
\n
"
,
expected
,
status
);
HeapFree
(
GetProcessHeap
(),
0
,
prop_item
);
GdipDisposeImage
(
image
);
winetest_pop_context
();
...
...
@@ -4176,19 +4202,6 @@ static void test_GdipGetAllPropertyItems(void)
"expected total property size %u, got %u
\n
"
,
prop_size
,
total_size
);
prop_item
=
HeapAlloc
(
GetProcessHeap
(),
0
,
prop_size
);
status
=
GdipGetAllPropertyItems
(
image
,
0
,
prop_count
,
prop_item
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
1
,
prop_item
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
prop_count
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
prop_count
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
0
,
0
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
+
1
,
prop_count
,
prop_item
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
prop_count
,
prop_item
);
expect
(
Ok
,
status
);
...
...
@@ -4932,19 +4945,6 @@ static void test_gif_properties(void)
"expected total property size %u, got %u
\n
"
,
prop_size
,
total_size
);
prop_item
=
HeapAlloc
(
GetProcessHeap
(),
0
,
prop_size
);
status
=
GdipGetAllPropertyItems
(
image
,
0
,
prop_count
,
prop_item
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
1
,
prop_item
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
prop_count
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
prop_count
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
0
,
0
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
+
1
,
prop_count
,
prop_item
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetAllPropertyItems
(
image
,
prop_size
,
prop_count
,
prop_item
);
expect
(
Ok
,
status
);
...
...
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