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

Unified Diff: webrtc/modules/interface/module_common_types.h

Issue 1174813003: Prepare to convert various types to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments + resync Created 5 years, 6 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 | « webrtc/modules/audio_processing/ns/nsx_core_neon.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/interface/module_common_types.h
diff --git a/webrtc/modules/interface/module_common_types.h b/webrtc/modules/interface/module_common_types.h
index 0b0e063a6fcc58723a62606343639b2bf3569fb1..92221551856e7f6dc79b0e730dc7ac67d2cc16f4 100644
--- a/webrtc/modules/interface/module_common_types.h
+++ b/webrtc/modules/interface/module_common_types.h
@@ -442,8 +442,9 @@ inline void AudioFrame::UpdateFrame(int id, uint32_t timestamp,
num_channels_ = num_channels;
energy_ = energy;
+ assert(num_channels >= 0);
const int length = samples_per_channel * num_channels;
- assert(length <= kMaxDataSizeSamples && length >= 0);
+ assert(length <= kMaxDataSizeSamples);
if (data != NULL) {
memcpy(data_, data, sizeof(int16_t) * length);
} else {
@@ -466,8 +467,9 @@ inline void AudioFrame::CopyFrom(const AudioFrame& src) {
energy_ = src.energy_;
interleaved_ = src.interleaved_;
+ assert(num_channels_ >= 0);
const int length = samples_per_channel_ * num_channels_;
- assert(length <= kMaxDataSizeSamples && length >= 0);
+ assert(length <= kMaxDataSizeSamples);
memcpy(data_, src.data_, sizeof(int16_t) * length);
}
« no previous file with comments | « webrtc/modules/audio_processing/ns/nsx_core_neon.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698