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

Unified Diff: webrtc/modules/audio_processing/transient/wpd_tree.cc

Issue 1685993003: Fix negative shift exponent in WPDTree (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/transient/wpd_tree.cc
diff --git a/webrtc/modules/audio_processing/transient/wpd_tree.cc b/webrtc/modules/audio_processing/transient/wpd_tree.cc
index 40a37a02865cc3916a838578589862444bd0dc71..227b48ade6adfe4c99cdb64708de46b8149bb4d7 100644
--- a/webrtc/modules/audio_processing/transient/wpd_tree.cc
+++ b/webrtc/modules/audio_processing/transient/wpd_tree.cc
@@ -66,10 +66,10 @@ WPDTree::WPDTree(size_t data_length, const float* high_pass_coefficients,
WPDTree::~WPDTree() {}
WPDNode* WPDTree::NodeAt(int level, int index) {
- const int kNumNodesAtLevel = 1 << level;
- if (level < 0 || level > levels_ || index < 0 || index >= kNumNodesAtLevel) {
+ if (level < 0 || level > levels_ || index < 0 || index >= 1 << level) {
return NULL;
}
+
return nodes_[(1 << level) + index].get();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698