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
bc389cff
Commit
bc389cff
authored
Mar 06, 2019
by
Michael Müller
Committed by
Alexandre Julliard
Mar 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iccvid: Fix calculation of stride and size.
Signed-off-by:
Vijay Kiran Kamuju
<
infyquest@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f59e7f83
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
3 deletions
+52
-3
iccvid.c
dlls/iccvid/iccvid.c
+7
-3
msvfw.c
dlls/msvfw32/tests/msvfw.c
+45
-0
No files found.
dlls/iccvid/iccvid.c
View file @
bc389cff
...
...
@@ -169,6 +169,10 @@ int x, y;
}
}
static
inline
int
get_stride
(
int
width
,
int
depth
)
{
return
((
depth
*
width
+
31
)
>>
3
)
&
~
3
;
}
/* ------------------------------------------------------------------------ */
static
void
cvid_v4_32
(
unsigned
char
*
frm
,
unsigned
char
*
limit
,
int
stride
,
BOOL
inverted
,
...
...
@@ -450,7 +454,7 @@ static void decode_cinepak(cinepak_info *cvinfo, unsigned char *buf, int size,
break
;
}
frm_stride
=
out_width
*
bpp
;
frm_stride
=
get_stride
(
out_width
,
bpp
*
8
)
;
frm_ptr
=
output
;
if
(
frame
.
length
!=
size
)
...
...
@@ -835,9 +839,9 @@ static LRESULT ICCVID_DecompressGetFormat( ICCVID_Info *info, LPBITMAPINFO in, L
if
(
out
)
{
memcpy
(
out
,
in
,
size
);
out
->
bmiHeader
.
biBitCount
=
24
;
out
->
bmiHeader
.
biCompression
=
BI_RGB
;
out
->
bmiHeader
.
biSizeImage
=
in
->
bmiHeader
.
biHeight
*
in
->
bmiHeader
.
biWidth
*
4
;
out
->
bmiHeader
.
biSizeImage
=
get_stride
(
in
->
bmiHeader
.
biWidth
,
24
)
*
in
->
bmiHeader
.
biHeight
;
return
ICERR_OK
;
}
return
size
;
...
...
dlls/msvfw32/tests/msvfw.c
View file @
bc389cff
...
...
@@ -25,6 +25,11 @@
#include "wine/test.h"
static
inline
int
get_stride
(
int
width
,
int
depth
)
{
return
((
depth
*
width
+
31
)
>>
3
)
&
~
3
;
}
static
void
test_OpenCase
(
void
)
{
HIC
h
;
...
...
@@ -88,6 +93,7 @@ static void test_Locate(void)
{
static
BITMAPINFOHEADER
bi
=
{
sizeof
(
BITMAPINFOHEADER
),
32
,
8
,
1
,
8
,
BI_RLE8
,
0
,
100000
,
100000
,
0
,
0
};
static
BITMAPINFOHEADER
bo
=
{
sizeof
(
BITMAPINFOHEADER
),
32
,
8
,
1
,
8
,
BI_RGB
,
0
,
100000
,
100000
,
0
,
0
};
BITMAPINFOHEADER
tmp
=
{
sizeof
(
BITMAPINFOHEADER
)};
HIC
h
;
DWORD
err
;
...
...
@@ -123,6 +129,45 @@ static void test_Locate(void)
ok
(
err
==
ICERR_OK
,
"Query cvid->RGB32 height<0: %d
\n
"
,
err
);
bo
.
biHeight
=
-
bo
.
biHeight
;
bi
.
biWidth
=
17
;
bi
.
biBitCount
=
8
;
err
=
ICDecompressGetFormat
(
h
,
&
bi
,
&
tmp
);
ok
(
err
==
ICERR_OK
,
"Query cvid output format: %d
\n
"
,
err
);
ok
(
tmp
.
biBitCount
==
24
,
"Expected 24 bit, got %d bit
\n
"
,
tmp
.
biBitCount
);
ok
(
tmp
.
biSizeImage
==
get_stride
(
17
,
24
)
*
8
,
"Expected size %d, got %d
\n
"
,
get_stride
(
17
,
24
)
*
8
,
tmp
.
biSizeImage
);
bi
.
biBitCount
=
15
;
err
=
ICDecompressGetFormat
(
h
,
&
bi
,
&
tmp
);
ok
(
err
==
ICERR_OK
,
"Query cvid output format: %d
\n
"
,
err
);
ok
(
tmp
.
biBitCount
==
24
,
"Expected 24 bit, got %d bit
\n
"
,
tmp
.
biBitCount
);
ok
(
tmp
.
biSizeImage
==
get_stride
(
17
,
24
)
*
8
,
"Expected size %d, got %d
\n
"
,
get_stride
(
17
,
24
)
*
8
,
tmp
.
biSizeImage
);
bi
.
biBitCount
=
16
;
err
=
ICDecompressGetFormat
(
h
,
&
bi
,
&
tmp
);
ok
(
err
==
ICERR_OK
,
"Query cvid output format: %d
\n
"
,
err
);
ok
(
tmp
.
biBitCount
==
24
,
"Expected 24 bit, got %d bit
\n
"
,
tmp
.
biBitCount
);
ok
(
tmp
.
biSizeImage
==
get_stride
(
17
,
24
)
*
8
,
"Expected size %d, got %d
\n
"
,
get_stride
(
17
,
24
)
*
8
,
tmp
.
biSizeImage
);
bi
.
biBitCount
=
24
;
err
=
ICDecompressGetFormat
(
h
,
&
bi
,
&
tmp
);
ok
(
err
==
ICERR_OK
,
"Query cvid output format: %d
\n
"
,
err
);
ok
(
tmp
.
biBitCount
==
24
,
"Expected 24 bit, got %d bit
\n
"
,
tmp
.
biBitCount
);
ok
(
tmp
.
biSizeImage
==
get_stride
(
17
,
24
)
*
8
,
"Expected size %d, got %d
\n
"
,
get_stride
(
17
,
24
)
*
8
,
tmp
.
biSizeImage
);
bi
.
biBitCount
=
32
;
err
=
ICDecompressGetFormat
(
h
,
&
bi
,
&
tmp
);
ok
(
err
==
ICERR_OK
,
"Query cvid output format: %d
\n
"
,
err
);
ok
(
tmp
.
biBitCount
==
24
,
"Expected 24 bit, got %d bit
\n
"
,
tmp
.
biBitCount
);
ok
(
tmp
.
biSizeImage
==
get_stride
(
17
,
24
)
*
8
,
"Expected size %d, got %d
\n
"
,
get_stride
(
17
,
24
)
*
8
,
tmp
.
biSizeImage
);
bi
.
biWidth
=
32
;
ok
(
ICClose
(
h
)
==
ICERR_OK
,
"ICClose failed
\n
"
);
bo
.
biBitCount
=
bi
.
biBitCount
=
8
;
...
...
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