Initialize variables to measure preemptive expansion and acceleration
The variables that are used to track the amount of preemptive expansion and acceleration are not initialized before being passed to their respective functions. However, these function can fail in certain cases, and when they do the uninitialized memory will pollute the NetEq statistics. Bug: chromium:1140376 Change-Id: I004fbaaf8d24de01dd1997fb73bdf93ca88ceaaf Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191480 Commit-Queue: Ivo Creusen <ivoc@webrtc.org> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32544}
This commit is contained in:
@ -1722,7 +1722,7 @@ int NetEqImpl::DoAccelerate(int16_t* decoded_buffer,
|
||||
decoded_length = required_samples * num_channels;
|
||||
}
|
||||
|
||||
size_t samples_removed;
|
||||
size_t samples_removed = 0;
|
||||
Accelerate::ReturnCodes return_code =
|
||||
accelerate_->Process(decoded_buffer, decoded_length, fast_accelerate,
|
||||
algorithm_buffer_.get(), &samples_removed);
|
||||
@ -1800,7 +1800,7 @@ int NetEqImpl::DoPreemptiveExpand(int16_t* decoded_buffer,
|
||||
decoded_length = required_samples * num_channels;
|
||||
}
|
||||
|
||||
size_t samples_added;
|
||||
size_t samples_added = 0;
|
||||
PreemptiveExpand::ReturnCodes return_code = preemptive_expand_->Process(
|
||||
decoded_buffer, decoded_length, old_borrowed_samples_per_channel,
|
||||
algorithm_buffer_.get(), &samples_added);
|
||||
|
||||
Reference in New Issue
Block a user