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
5ec0ce5b
Commit
5ec0ce5b
authored
Nov 06, 2006
by
Markus Amsler
Committed by
Alexandre Julliard
Nov 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use width while converting surfaces.
This fixes also a heap corruption with 1x1 and 2x2 surfaces.
parent
5864d18c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
surface.c
dlls/wined3d/surface.c
+10
-8
No files found.
dlls/wined3d/surface.c
View file @
5ec0ce5b
...
...
@@ -47,7 +47,7 @@ typedef enum {
CONVERT_RGB32_888
}
CONVERT_TYPES
;
HRESULT
d3dfmt_convert_surface
(
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
height
,
UINT
outpitch
,
CONVERT_TYPES
convert
,
IWineD3DSurfaceImpl
*
surf
);
HRESULT
d3dfmt_convert_surface
(
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
,
UINT
outpitch
,
CONVERT_TYPES
convert
,
IWineD3DSurfaceImpl
*
surf
);
static
void
surface_download_data
(
IWineD3DSurfaceImpl
*
This
)
{
if
(
This
->
resource
.
format
==
WINED3DFMT_DXT1
||
...
...
@@ -991,6 +991,7 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This) {
d3dfmt_convert_surface
(
This
->
resource
.
allocatedMemory
,
mem
,
pitch
,
pitch
,
height
,
pitch
*
4
,
CONVERT_PALETTED
,
...
...
@@ -1572,8 +1573,8 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
return
WINED3D_OK
;
}
HRESULT
d3dfmt_convert_surface
(
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
height
,
UINT
outpitch
,
CONVERT_TYPES
convert
,
IWineD3DSurfaceImpl
*
surf
)
{
BYTE
*
dest
;
HRESULT
d3dfmt_convert_surface
(
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
,
UINT
outpitch
,
CONVERT_TYPES
convert
,
IWineD3DSurfaceImpl
*
surf
)
{
BYTE
*
source
,
*
dest
;
TRACE
(
"(%p)->(%p),(%d,%d,%d,%d,%p)
\n
"
,
src
,
dst
,
pitch
,
height
,
outpitch
,
convert
,
surf
);
switch
(
convert
)
{
...
...
@@ -1636,10 +1637,11 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT height, UI
for
(
y
=
0
;
y
<
height
;
y
++
)
{
source
=
src
+
pitch
*
y
;
dest
=
dst
+
outpitch
*
y
;
/* This is an 1 bpp format, using the
pitc
h here is fine */
for
(
x
=
0
;
x
<
pitc
h
;
x
++
)
{
BYTE
color
=
*
s
rc
++
;
/* This is an 1 bpp format, using the
widt
h here is fine */
for
(
x
=
0
;
x
<
widt
h
;
x
++
)
{
BYTE
color
=
*
s
ource
++
;
*
dest
++
=
table
[
color
][
0
];
*
dest
++
=
table
[
color
][
1
];
*
dest
++
=
table
[
color
][
2
];
...
...
@@ -1670,7 +1672,7 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT height, UI
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
WORD
*
)
(
src
+
y
*
pitch
);
Dest
=
(
WORD
*
)
(
dst
+
y
*
outpitch
);
for
(
x
=
0
;
x
<
pitc
h
/
2
;
x
++
)
{
for
(
x
=
0
;
x
<
widt
h
/
2
;
x
++
)
{
WORD
color
=
*
Source
++
;
*
Dest
=
((
color
&
0xFFC0
)
|
((
color
&
0x1F
)
<<
1
));
if
((
color
<
surf
->
SrcBltCKey
.
dwColorSpaceLowValue
)
||
...
...
@@ -1849,7 +1851,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
ERR
(
"Out of memory %d, %d!
\n
"
,
outpitch
,
height
);
return
WINED3DERR_OUTOFVIDEOMEMORY
;
}
d3dfmt_convert_surface
(
This
->
resource
.
allocatedMemory
,
mem
,
pitch
,
height
,
outpitch
,
convert
,
This
);
d3dfmt_convert_surface
(
This
->
resource
.
allocatedMemory
,
mem
,
pitch
,
width
,
height
,
outpitch
,
convert
,
This
);
This
->
Flags
|=
SFLAG_CONVERTED
;
}
else
if
(
This
->
resource
.
format
==
WINED3DFMT_P8
&&
GL_SUPPORT
(
EXT_PALETTED_TEXTURE
))
{
...
...
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