summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-05 01:05:08 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-05 01:05:08 +0200
commit5bbeb516aa3539e30fccf228d5ac31381209a578 (patch)
tree6526c11c4220a5bc47d63449070e4dc328fd61a1
parent53fcf3add0521b83e8b5226e6660d2ec9548f48c (diff)
simple: split data/length validity checks into two
-rw-r--r--src/pulse/simple.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pulse/simple.c b/src/pulse/simple.c
index b5e108fb..1e0f3e18 100644
--- a/src/pulse/simple.c
+++ b/src/pulse/simple.c
@@ -276,7 +276,8 @@ int pa_simple_write(pa_simple *p, const void*data, size_t length, int *rerror) {
pa_assert(p);
CHECK_VALIDITY_RETURN_ANY(rerror, p->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE, -1);
- CHECK_VALIDITY_RETURN_ANY(rerror, data && length, PA_ERR_INVALID, -1);
+ CHECK_VALIDITY_RETURN_ANY(rerror, data, PA_ERR_INVALID, -1);
+ CHECK_VALIDITY_RETURN_ANY(rerror, length > 0, PA_ERR_INVALID, -1);
pa_threaded_mainloop_lock(p->mainloop);
@@ -315,7 +316,8 @@ int pa_simple_read(pa_simple *p, void*data, size_t length, int *rerror) {
pa_assert(p);
CHECK_VALIDITY_RETURN_ANY(rerror, p->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE, -1);
- CHECK_VALIDITY_RETURN_ANY(rerror, data && length, PA_ERR_INVALID, -1);
+ CHECK_VALIDITY_RETURN_ANY(rerror, data, PA_ERR_INVALID, -1);
+ CHECK_VALIDITY_RETURN_ANY(rerror, length > 0, PA_ERR_INVALID, -1);
pa_threaded_mainloop_lock(p->mainloop);