Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: webrtc/common_audio/ring_buffer.h

Issue 2971313002: Add a check in the BlockBuffer of AEC2 to guard for buffer overflows. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/common_audio/ring_buffer.c » ('j') | webrtc/modules/audio_processing/aec/aec_core.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/ring_buffer.h
diff --git a/webrtc/common_audio/ring_buffer.h b/webrtc/common_audio/ring_buffer.h
index baa1df4fe0db5970aa26034defb11c2b9782dc26..46759b66971a21de2a936b486e63dbb92ca372b1 100644
--- a/webrtc/common_audio/ring_buffer.h
+++ b/webrtc/common_audio/ring_buffer.h
@@ -36,12 +36,13 @@ RingBuffer* WebRtc_CreateBuffer(size_t element_count, size_t element_size);
void WebRtc_InitBuffer(RingBuffer* handle);
void WebRtc_FreeBuffer(void* handle);
-// Reads data from the buffer. The |data_ptr| will point to the address where
-// it is located. If all |element_count| data are feasible to read without
-// buffer wrap around |data_ptr| will point to the location in the buffer.
-// Otherwise, the data will be copied to |data| (memory allocation done by the
-// user) and |data_ptr| points to the address of |data|. |data_ptr| is only
-// guaranteed to be valid until the next call to WebRtc_WriteBuffer().
+// Reads data from the buffer. Returns the number of elements that were read.
+// The |data_ptr| will point to the address where the read data is located.
+// If no data can be read, |data_ptr| is set to |NULL|. If all data can be read
+// without buffer wrap around then |data_ptr| will point to the location in the
+// buffer. Otherwise, the data will be copied to |data| (memory allocation done
+// by the user) and |data_ptr| points to the address of |data|. |data_ptr| is
+// only guaranteed to be valid until the next call to WebRtc_WriteBuffer().
//
// To force a copying to |data|, pass a null |data_ptr|.
//
« no previous file with comments | « no previous file | webrtc/common_audio/ring_buffer.c » ('j') | webrtc/modules/audio_processing/aec/aec_core.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698