aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/base/ringbuffer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/base/ringbuffer.cpp b/src/base/ringbuffer.cpp
index 7adcd332..d324f74f 100644
--- a/src/base/ringbuffer.cpp
+++ b/src/base/ringbuffer.cpp
@@ -51,6 +51,10 @@ namespace usdx
if (count <= 0)
return count;
+ // check if the buffer is NULL
+ if (buffer == NULL)
+ return -1;
+
// adjust output count
if (count > buffer_count)
{
@@ -81,6 +85,10 @@ namespace usdx
if (count <= 0)
return count;
+ // check if the buffer is NULL
+ if (buffer == NULL)
+ return -1;
+
// skip input data if the input buffer is bigger than the ring-buffer
if (count > buffer_size)
{