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
73d539e6
Commit
73d539e6
authored
May 29, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Always check TIFF sample count and planar configuration.
This more closely matches the TIFF spec. These values are valid for all photometric interpretations.
parent
e486a17a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
14 deletions
+34
-14
tiffformat.c
dlls/windowscodecs/tiffformat.c
+34
-14
No files found.
dlls/windowscodecs/tiffformat.c
View file @
73d539e6
...
...
@@ -202,6 +202,7 @@ typedef struct {
int
bps
;
int
samples
;
int
bpp
;
int
planar
;
int
indexed
;
int
reverse_bgr
;
UINT
width
,
height
;
...
...
@@ -224,7 +225,7 @@ static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl;
static
HRESULT
tiff_get_decode_info
(
TIFF
*
tiff
,
tiff_decode_info
*
decode_info
)
{
uint16
photometric
,
bps
,
samples
=
1
,
planar
;
uint16
photometric
,
bps
,
samples
,
planar
;
int
ret
;
decode_info
->
indexed
=
0
;
...
...
@@ -239,12 +240,35 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_BITSPERSAMPLE
,
&
bps
);
if
(
!
ret
)
bps
=
1
;
decode_info
->
bps
=
bps
;
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_SAMPLESPERPIXEL
,
&
samples
);
if
(
!
ret
)
samples
=
1
;
decode_info
->
samples
=
samples
;
if
(
samples
==
1
)
planar
=
1
;
else
{
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_PLANARCONFIG
,
&
planar
);
if
(
!
ret
)
planar
=
1
;
if
(
planar
!=
1
)
{
FIXME
(
"unhandled planar configuration %u
\n
"
,
planar
);
return
E_FAIL
;
}
}
decode_info
->
planar
=
planar
;
switch
(
photometric
)
{
case
1
:
/* BlackIsZero */
if
(
samples
!=
1
)
{
FIXME
(
"unhandled grayscale sample count %u
\n
"
,
samples
);
return
E_FAIL
;
}
decode_info
->
bpp
=
bps
;
switch
(
bps
)
{
...
...
@@ -263,22 +287,14 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
}
break
;
case
2
:
/* RGB */
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_PLANARCONFIG
,
&
planar
);
if
(
!
ret
)
planar
=
1
;
if
(
planar
!=
1
)
{
FIXME
(
"unhandled planar configuration %u
\n
"
,
planar
);
return
E_FAIL
;
}
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_SAMPLESPERPIXEL
,
&
samples
);
decode_info
->
bpp
=
bps
*
samples
;
if
(
samples
!=
3
)
{
FIXME
(
"unhandled RGB sample count %u
\n
"
,
samples
);
return
E_FAIL
;
}
decode_info
->
bpp
=
bps
*
samples
;
switch
(
bps
)
{
case
8
:
...
...
@@ -294,6 +310,12 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
}
break
;
case
3
:
/* RGB Palette */
if
(
samples
!=
1
)
{
FIXME
(
"unhandled indexed sample count %u
\n
"
,
samples
);
return
E_FAIL
;
}
decode_info
->
indexed
=
1
;
decode_info
->
bpp
=
bps
;
switch
(
bps
)
...
...
@@ -319,8 +341,6 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
return
E_FAIL
;
}
decode_info
->
samples
=
samples
;
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_IMAGEWIDTH
,
&
decode_info
->
width
);
if
(
!
ret
)
{
...
...
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