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
fc2b2b1b
Commit
fc2b2b1b
authored
Nov 14, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wincodecs: Grab TIFF decoder reference when creating frames.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bb2e0980
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
tiffformat.c
dlls/windowscodecs/tests/tiffformat.c
+12
-1
tiffformat.c
dlls/windowscodecs/tiffformat.c
+3
-1
No files found.
dlls/windowscodecs/tests/tiffformat.c
View file @
fc2b2b1b
...
...
@@ -26,6 +26,15 @@
#include "wincodec.h"
#include "wine/test.h"
#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
static
void
_expect_ref
(
IUnknown
*
obj
,
ULONG
ref
,
int
line
)
{
ULONG
rc
;
IUnknown_AddRef
(
obj
);
rc
=
IUnknown_Release
(
obj
);
ok_
(
__FILE__
,
line
)(
rc
==
ref
,
"expected refcount %d, got %d
\n
"
,
ref
,
rc
);
}
#define IFD_BYTE 1
#define IFD_ASCII 2
#define IFD_SHORT 3
...
...
@@ -407,8 +416,11 @@ static void test_tiff_8bpp_alpha(void)
ok
(
hr
==
S_OK
,
"GetFrameCount error %#x
\n
"
,
hr
);
ok
(
frame_count
==
1
,
"expected 1, got %u
\n
"
,
frame_count
);
EXPECT_REF
(
decoder
,
1
);
hr
=
IWICBitmapDecoder_GetFrame
(
decoder
,
0
,
&
frame
);
ok
(
hr
==
S_OK
,
"GetFrame error %#x
\n
"
,
hr
);
EXPECT_REF
(
decoder
,
2
);
IWICBitmapDecoder_Release
(
decoder
);
hr
=
IWICBitmapFrameDecode_GetSize
(
frame
,
&
width
,
&
height
);
ok
(
hr
==
S_OK
,
"GetSize error %#x
\n
"
,
hr
);
...
...
@@ -443,7 +455,6 @@ static void test_tiff_8bpp_alpha(void)
ok
(
data
[
i
]
==
expected_data
[
i
],
"%u: expected %02x, got %02x
\n
"
,
i
,
expected_data
[
i
],
data
[
i
]);
IWICBitmapFrameDecode_Release
(
frame
);
IWICBitmapDecoder_Release
(
decoder
);
}
static
void
test_tiff_resolution
(
void
)
...
...
dlls/windowscodecs/tiffformat.c
View file @
fc2b2b1b
...
...
@@ -766,6 +766,7 @@ static HRESULT WINAPI TiffDecoder_GetFrame(IWICBitmapDecoder *iface,
result
->
IWICMetadataBlockReader_iface
.
lpVtbl
=
&
TiffFrameDecode_BlockVtbl
;
result
->
ref
=
1
;
result
->
parent
=
This
;
IWICBitmapDecoder_AddRef
(
iface
);
result
->
index
=
index
;
result
->
decode_info
=
decode_info
;
result
->
cached_tile_x
=
-
1
;
...
...
@@ -776,7 +777,7 @@ static HRESULT WINAPI TiffDecoder_GetFrame(IWICBitmapDecoder *iface,
else
{
hr
=
E_OUTOFMEMORY
;
HeapFree
(
GetProcessHeap
(),
0
,
result
);
IWICBitmapFrameDecode_Release
(
&
result
->
IWICBitmapFrameDecode_iface
);
}
}
else
hr
=
E_OUTOFMEMORY
;
...
...
@@ -851,6 +852,7 @@ static ULONG WINAPI TiffFrameDecode_Release(IWICBitmapFrameDecode *iface)
if
(
ref
==
0
)
{
IWICBitmapDecoder_Release
(
&
This
->
parent
->
IWICBitmapDecoder_iface
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
cached_tile
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
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