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
fe7885be
Commit
fe7885be
authored
Mar 03, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Don't reorder gif extension blocks in GetReaderByIndex.
parent
9c22a5ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
46 deletions
+36
-46
gifformat.c
dlls/windowscodecs/gifformat.c
+22
-32
metadata.c
dlls/windowscodecs/tests/metadata.c
+14
-14
No files found.
dlls/windowscodecs/gifformat.c
View file @
fe7885be
...
@@ -947,7 +947,10 @@ static HRESULT WINAPI GifFrameDecode_Block_GetReaderByIndex(IWICMetadataBlockRea
...
@@ -947,7 +947,10 @@ static HRESULT WINAPI GifFrameDecode_Block_GetReaderByIndex(IWICMetadataBlockRea
UINT
index
,
IWICMetadataReader
**
reader
)
UINT
index
,
IWICMetadataReader
**
reader
)
{
{
GifFrameDecode
*
This
=
frame_from_IWICMetadataBlockReader
(
iface
);
GifFrameDecode
*
This
=
frame_from_IWICMetadataBlockReader
(
iface
);
int
i
,
gce_index
=
-
1
,
gce_skipped
=
0
;
class_constructor
constructor
;
ExtensionBlock
*
ext
;
const
void
*
data
;
int
data_size
;
TRACE
(
"(%p,%u,%p)
\n
"
,
iface
,
index
,
reader
);
TRACE
(
"(%p,%u,%p)
\n
"
,
iface
,
index
,
reader
);
...
@@ -959,40 +962,27 @@ static HRESULT WINAPI GifFrameDecode_Block_GetReaderByIndex(IWICMetadataBlockRea
...
@@ -959,40 +962,27 @@ static HRESULT WINAPI GifFrameDecode_Block_GetReaderByIndex(IWICMetadataBlockRea
if
(
index
>=
This
->
frame
->
Extensions
.
ExtensionBlockCount
+
1
)
if
(
index
>=
This
->
frame
->
Extensions
.
ExtensionBlockCount
+
1
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
for
(
i
=
0
;
i
<
This
->
frame
->
Extensions
.
ExtensionBlockCount
;
i
++
)
ext
=
This
->
frame
->
Extensions
.
ExtensionBlocks
+
index
-
1
;
if
(
ext
->
Function
==
GRAPHICS_EXT_FUNC_CODE
)
{
{
class_constructor
constructor
;
constructor
=
GCEReader_CreateInstance
;
const
void
*
data
;
data
=
ext
->
Bytes
+
3
;
int
data_size
;
data_size
=
ext
->
ByteCount
-
4
;
}
if
(
index
!=
i
+
1
-
gce_skipped
)
continue
;
else
if
(
ext
->
Function
==
COMMENT_EXT_FUNC_CODE
)
{
if
(
This
->
frame
->
Extensions
.
ExtensionBlocks
[
i
].
Function
==
GRAPHICS_EXT_FUNC_CODE
)
constructor
=
GifCommentReader_CreateInstance
;
{
data
=
ext
->
Bytes
;
gce_index
=
i
;
data_size
=
ext
->
ByteCount
;
gce_skipped
=
1
;
}
continue
;
else
}
{
else
if
(
This
->
frame
->
Extensions
.
ExtensionBlocks
[
i
].
Function
==
COMMENT_EXT_FUNC_CODE
)
constructor
=
UnknownMetadataReader_CreateInstance
;
{
data
=
ext
->
Bytes
;
constructor
=
GifCommentReader_CreateInstance
;
data_size
=
ext
->
ByteCount
;
data
=
This
->
frame
->
Extensions
.
ExtensionBlocks
[
i
].
Bytes
;
data_size
=
This
->
frame
->
Extensions
.
ExtensionBlocks
[
i
].
ByteCount
;
}
else
{
constructor
=
UnknownMetadataReader_CreateInstance
;
data
=
This
->
frame
->
Extensions
.
ExtensionBlocks
[
i
].
Bytes
;
data_size
=
This
->
frame
->
Extensions
.
ExtensionBlocks
[
i
].
ByteCount
;
}
return
create_metadata_reader
(
data
,
data_size
,
constructor
,
reader
);
}
}
if
(
gce_index
==
-
1
)
return
E_INVALIDARG
;
return
create_metadata_reader
(
data
,
data_size
,
constructor
,
reader
);
return
create_metadata_reader
(
This
->
frame
->
Extensions
.
ExtensionBlocks
[
gce_index
].
Bytes
+
3
,
This
->
frame
->
Extensions
.
ExtensionBlocks
[
gce_index
].
ByteCount
-
4
,
GCEReader_CreateInstance
,
reader
);
}
}
static
HRESULT
WINAPI
GifFrameDecode_Block_GetEnumerator
(
IWICMetadataBlockReader
*
iface
,
static
HRESULT
WINAPI
GifFrameDecode_Block_GetEnumerator
(
IWICMetadataBlockReader
*
iface
,
...
...
dlls/windowscodecs/tests/metadata.c
View file @
fe7885be
...
@@ -188,10 +188,10 @@ static const char animatedgif[] = {
...
@@ -188,10 +188,10 @@ static const char animatedgif[] = {
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x01
,
0x00
,
0x81
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x01
,
0x00
,
0x81
,
0xDE
,
0xDE
,
0xDE
,
0x00
,
0x00
,
0x00
,
0xDE
,
0xDE
,
0xDE
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x02
,
0x4C
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x02
,
0x4C
,
0x01
,
0x00
,
0x21
,
0xF9
,
0x04
,
0x01
,
0x0A
,
0x00
,
0x01
,
0x00
,
0x21
,
0xFE
,
0x08
,
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
' '
,
'#'
,
'1'
,
0x00
,
0x21
,
0xFE
,
0x08
,
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
' '
,
'#'
,
'1'
,
0x00
,
0x21
,
0x01
,
0x0C
,
'p'
,
'l'
,
'a'
,
'i'
,
'n'
,
't'
,
'e'
,
'x'
,
't'
,
' '
,
'#'
,
'1'
,
0x00
,
0x21
,
0x01
,
0x0C
,
'p'
,
'l'
,
'a'
,
'i'
,
'n'
,
't'
,
'e'
,
'x'
,
't'
,
' '
,
'#'
,
'1'
,
0x00
,
0x21
,
0xF9
,
0x04
,
0x01
,
0x0A
,
0x00
,
0x01
,
0x00
,
0x2C
,
0x2C
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x01
,
0x00
,
0x81
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x01
,
0x00
,
0x81
,
0x4D
,
0x4D
,
0x4D
,
0x00
,
0x00
,
0x00
,
0x4D
,
0x4D
,
0x4D
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x02
,
0x44
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x02
,
0x44
,
0x01
,
0x00
,
0x21
,
0xFE
,
0x08
,
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
' '
,
'#'
,
'2'
,
0x00
,
0x21
,
0xFE
,
0x08
,
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
' '
,
'#'
,
'2'
,
0x00
,
...
@@ -1517,15 +1517,14 @@ static void test_metadata_gif(void)
...
@@ -1517,15 +1517,14 @@ static void test_metadata_gif(void)
{
{
hr
=
IWICMetadataReader_GetMetadataFormat
(
reader
,
&
format
);
hr
=
IWICMetadataReader_GetMetadataFormat
(
reader
,
&
format
);
ok
(
hr
==
S_OK
,
"GetMetadataFormat failed, hr=%#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetMetadataFormat failed, hr=%#lx
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
format
,
&
GUID_MetadataFormatG
ifComment
),
/* Comment
Extension */
ok
(
IsEqualGUID
(
&
format
,
&
GUID_MetadataFormatG
CE
),
/* Graphic Control
Extension */
"wrong metadata format %s
\n
"
,
wine_dbgstr_guid
(
&
format
));
"wrong metadata format %s
\n
"
,
wine_dbgstr_guid
(
&
format
));
hr
=
IWICMetadataReader_GetCount
(
reader
,
&
count
);
hr
=
IWICMetadataReader_GetCount
(
reader
,
&
count
);
ok
(
hr
==
S_OK
,
"GetCount error %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetCount error %#lx
\n
"
,
hr
);
ok
(
count
==
ARRAY_SIZE
(
animated_gif_
comment_2
),
"unexpected count %u
\n
"
,
count
);
ok
(
count
==
ARRAY_SIZE
(
animated_gif_
GCE
),
"unexpected count %u
\n
"
,
count
);
if
(
count
==
1
)
compare_metadata
(
reader
,
animated_gif_GCE
,
count
);
compare_metadata
(
reader
,
animated_gif_comment_2
,
count
);
IWICMetadataReader_Release
(
reader
);
IWICMetadataReader_Release
(
reader
);
}
}
...
@@ -1537,14 +1536,15 @@ static void test_metadata_gif(void)
...
@@ -1537,14 +1536,15 @@ static void test_metadata_gif(void)
{
{
hr
=
IWICMetadataReader_GetMetadataFormat
(
reader
,
&
format
);
hr
=
IWICMetadataReader_GetMetadataFormat
(
reader
,
&
format
);
ok
(
hr
==
S_OK
,
"GetMetadataFormat failed, hr=%#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetMetadataFormat failed, hr=%#lx
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
format
,
&
GUID_MetadataFormat
Unknown
),
ok
(
IsEqualGUID
(
&
format
,
&
GUID_MetadataFormat
GifComment
),
/* Comment Extension */
"wrong metadata format %s
\n
"
,
wine_dbgstr_guid
(
&
format
));
"wrong metadata format %s
\n
"
,
wine_dbgstr_guid
(
&
format
));
hr
=
IWICMetadataReader_GetCount
(
reader
,
&
count
);
hr
=
IWICMetadataReader_GetCount
(
reader
,
&
count
);
ok
(
hr
==
S_OK
,
"GetCount error %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetCount error %#lx
\n
"
,
hr
);
ok
(
count
==
ARRAY_SIZE
(
animated_gif_
plain
_2
),
"unexpected count %u
\n
"
,
count
);
ok
(
count
==
ARRAY_SIZE
(
animated_gif_
comment
_2
),
"unexpected count %u
\n
"
,
count
);
compare_metadata
(
reader
,
animated_gif_plain_2
,
count
);
if
(
count
==
1
)
compare_metadata
(
reader
,
animated_gif_comment_2
,
count
);
IWICMetadataReader_Release
(
reader
);
IWICMetadataReader_Release
(
reader
);
}
}
...
@@ -1556,14 +1556,14 @@ static void test_metadata_gif(void)
...
@@ -1556,14 +1556,14 @@ static void test_metadata_gif(void)
{
{
hr
=
IWICMetadataReader_GetMetadataFormat
(
reader
,
&
format
);
hr
=
IWICMetadataReader_GetMetadataFormat
(
reader
,
&
format
);
ok
(
hr
==
S_OK
,
"GetMetadataFormat failed, hr=%#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetMetadataFormat failed, hr=%#lx
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
format
,
&
GUID_MetadataFormat
GCE
),
/* Graphic Control Extension */
ok
(
IsEqualGUID
(
&
format
,
&
GUID_MetadataFormat
Unknown
),
"wrong metadata format %s
\n
"
,
wine_dbgstr_guid
(
&
format
));
"wrong metadata format %s
\n
"
,
wine_dbgstr_guid
(
&
format
));
hr
=
IWICMetadataReader_GetCount
(
reader
,
&
count
);
hr
=
IWICMetadataReader_GetCount
(
reader
,
&
count
);
ok
(
hr
==
S_OK
,
"GetCount error %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetCount error %#lx
\n
"
,
hr
);
ok
(
count
==
ARRAY_SIZE
(
animated_gif_
GCE
),
"unexpected count %u
\n
"
,
count
);
ok
(
count
==
ARRAY_SIZE
(
animated_gif_
plain_2
),
"unexpected count %u
\n
"
,
count
);
compare_metadata
(
reader
,
animated_gif_
GCE
,
count
);
compare_metadata
(
reader
,
animated_gif_
plain_2
,
count
);
IWICMetadataReader_Release
(
reader
);
IWICMetadataReader_Release
(
reader
);
}
}
...
...
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