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
b8d58650
Commit
b8d58650
authored
Jun 21, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Handle IFD fields with count 0 same way as with count 1.
parent
e4af117c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
metadatahandler.c
dlls/windowscodecs/metadatahandler.c
+20
-0
metadata.c
dlls/windowscodecs/tests/metadata.c
+10
-2
No files found.
dlls/windowscodecs/metadatahandler.c
View file @
b8d58650
...
...
@@ -718,6 +718,8 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry,
{
case
IFD_BYTE
:
case
IFD_SBYTE
:
if
(
!
count
)
count
=
1
;
if
(
count
<=
4
)
{
const
BYTE
*
data
=
(
const
BYTE
*
)
&
entry
->
value
;
...
...
@@ -755,6 +757,8 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry,
break
;
case
IFD_SHORT
:
case
IFD_SSHORT
:
if
(
!
count
)
count
=
1
;
if
(
count
<=
2
)
{
const
SHORT
*
data
=
(
const
SHORT
*
)
&
entry
->
value
;
...
...
@@ -800,6 +804,8 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry,
case
IFD_LONG
:
case
IFD_SLONG
:
case
IFD_FLOAT
:
if
(
!
count
)
count
=
1
;
if
(
count
==
1
)
{
item
->
value
.
u
.
ulVal
=
value
;
...
...
@@ -830,6 +836,13 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry,
case
IFD_RATIONAL
:
case
IFD_SRATIONAL
:
case
IFD_DOUBLE
:
if
(
!
count
)
{
FIXME
(
"IFD field type %d, count 0
\n
"
,
type
);
item
->
value
.
vt
=
VT_EMPTY
;
break
;
}
if
(
count
==
1
)
{
ULONGLONG
ull
;
...
...
@@ -882,6 +895,13 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry,
item
->
value
.
u
.
pszVal
[
count
]
=
0
;
break
;
case
IFD_UNDEFINED
:
if
(
!
count
)
{
FIXME
(
"IFD field type %d, count 0
\n
"
,
type
);
item
->
value
.
vt
=
VT_EMPTY
;
break
;
}
item
->
value
.
u
.
blob
.
pBlobData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
);
if
(
!
item
->
value
.
u
.
blob
.
pBlobData
)
return
E_OUTOFMEMORY
;
...
...
dlls/windowscodecs/tests/metadata.c
View file @
b8d58650
...
...
@@ -82,7 +82,7 @@ static const struct ifd_data
FLOAT
float_val
[
2
];
}
IFD_data
=
{
2
3
,
2
7
,
{
{
0xfe
,
IFD_SHORT
,
1
,
1
},
/* NEWSUBFILETYPE */
{
0x100
,
IFD_LONG
,
1
,
222
},
/* IMAGEWIDTH */
...
...
@@ -107,6 +107,10 @@ static const struct ifd_data
{
0xf00f
,
IFD_ASCII
,
4
,
'a'
|
'b'
<<
8
|
'c'
<<
16
|
'd'
<<
24
},
{
0xf010
,
IFD_UNDEFINED
,
13
,
FIELD_OFFSET
(
struct
ifd_data
,
string
)
},
{
0xf011
,
IFD_UNDEFINED
,
4
,
'a'
|
'b'
<<
8
|
'c'
<<
16
|
'd'
<<
24
},
{
0xf012
,
IFD_BYTE
,
0
,
0x11223344
},
{
0xf013
,
IFD_SHORT
,
0
,
0x11223344
},
{
0xf014
,
IFD_LONG
,
0
,
0x11223344
},
{
0xf015
,
IFD_FLOAT
,
0
,
0x11223344
},
},
0
,
{
900
,
3
},
...
...
@@ -390,7 +394,7 @@ static void test_metadata_IFD(void)
int
count
;
/* if VT_VECTOR */
LONGLONG
value
[
13
];
const
char
*
string
;
}
td
[
2
3
]
=
}
td
[
2
7
]
=
{
{
VT_UI2
,
0xfe
,
0
,
{
1
}
},
{
VT_UI4
,
0x100
,
0
,
{
222
}
},
...
...
@@ -415,6 +419,10 @@ static void test_metadata_IFD(void)
{
VT_LPSTR
,
0xf00f
,
4
,
{
0
},
"abcd"
},
{
VT_BLOB
,
0xf010
,
13
,
{
0
},
"Hello World!"
},
{
VT_BLOB
,
0xf011
,
4
,
{
0
},
"abcd"
},
{
VT_UI1
,
0xf012
,
0
,
{
0x44
}
},
{
VT_UI2
,
0xf013
,
0
,
{
0x3344
}
},
{
VT_UI4
,
0xf014
,
0
,
{
0x11223344
}
},
{
VT_R4
,
0xf015
,
0
,
{
0x11223344
}
},
};
HRESULT
hr
;
IWICMetadataReader
*
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