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
aff1dbe5
Commit
aff1dbe5
authored
Jan 02, 2009
by
Jeff Zaroyko
Committed by
Alexandre Julliard
Jan 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Check for invalid parameter when locking primary and secondary buffers.
parent
14db7003
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
buffer.c
dlls/dsound/buffer.c
+3
-0
primary.c
dlls/dsound/primary.c
+3
-0
ds3d.c
dlls/dsound/tests/ds3d.c
+4
-0
No files found.
dlls/dsound/buffer.c
View file @
aff1dbe5
...
@@ -532,6 +532,9 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Lock(
...
@@ -532,6 +532,9 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Lock(
GetTickCount
()
GetTickCount
()
);
);
if
(
!
audiobytes1
)
return
DSERR_INVALIDPARAM
;
/* when this flag is set, writecursor is meaningless and must be calculated */
/* when this flag is set, writecursor is meaningless and must be calculated */
if
(
flags
&
DSBLOCK_FROMWRITECURSOR
)
{
if
(
flags
&
DSBLOCK_FROMWRITECURSOR
)
{
/* GetCurrentPosition does too much magic to duplicate here */
/* GetCurrentPosition does too much magic to duplicate here */
...
...
dlls/dsound/primary.c
View file @
aff1dbe5
...
@@ -837,6 +837,9 @@ static HRESULT WINAPI PrimaryBufferImpl_Lock(
...
@@ -837,6 +837,9 @@ static HRESULT WINAPI PrimaryBufferImpl_Lock(
GetTickCount
()
GetTickCount
()
);
);
if
(
!
audiobytes1
)
return
DSERR_INVALIDPARAM
;
if
(
device
->
priolevel
!=
DSSCL_WRITEPRIMARY
)
{
if
(
device
->
priolevel
!=
DSSCL_WRITEPRIMARY
)
{
WARN
(
"failed priority check!
\n
"
);
WARN
(
"failed priority check!
\n
"
);
return
DSERR_PRIOLEVELNEEDED
;
return
DSERR_PRIOLEVELNEEDED
;
...
...
dlls/dsound/tests/ds3d.c
View file @
aff1dbe5
...
@@ -184,6 +184,10 @@ static int buffer_refill(play_state_t* state, DWORD size)
...
@@ -184,6 +184,10 @@ static int buffer_refill(play_state_t* state, DWORD size)
if
(
size
>
state
->
wave_len
-
state
->
written
)
if
(
size
>
state
->
wave_len
-
state
->
written
)
size
=
state
->
wave_len
-
state
->
written
;
size
=
state
->
wave_len
-
state
->
written
;
/* some broken apps like Navyfield mistakenly pass NULL for a ppValue */
rc
=
IDirectSoundBuffer_Lock
(
state
->
dsbo
,
state
->
offset
,
size
,
&
ptr1
,
NULL
,
&
ptr2
,
&
len2
,
0
);
ok
(
rc
==
DSERR_INVALIDPARAM
,
"expected %08x got %08x
\n
"
,
DSERR_INVALIDPARAM
,
rc
);
rc
=
IDirectSoundBuffer_Lock
(
state
->
dsbo
,
state
->
offset
,
size
,
rc
=
IDirectSoundBuffer_Lock
(
state
->
dsbo
,
state
->
offset
,
size
,
&
ptr1
,
&
len1
,
&
ptr2
,
&
len2
,
0
);
&
ptr1
,
&
len1
,
&
ptr2
,
&
len2
,
0
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Lock() failed: %08x
\n
"
,
rc
);
ok
(
rc
==
DS_OK
,
"IDirectSoundBuffer_Lock() failed: %08x
\n
"
,
rc
);
...
...
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