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

Unified Diff: webrtc/modules/audio_coding/main/acm2/rent_a_codec.h

Issue 1407383010: Correctly handle the error case where the CodecId has a negative value (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month 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_coding/main/acm2/rent_a_codec.h
diff --git a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
index 24ae121a478c44f10f339d81afd035c71243029b..dc441249e20ff5c8168f35d07feec82c523b96e3 100644
--- a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
+++ b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
@@ -132,9 +132,9 @@ class RentACodec {
}
static inline rtc::Maybe<int> CodecIndexFromId(CodecId codec_id) {
- const int i = static_cast<int>(codec_id);
- return i < static_cast<int>(NumberOfCodecs()) ? rtc::Maybe<int>(i)
- : rtc::Maybe<int>();
+ const size_t i = static_cast<size_t>(codec_id);
hlundin-webrtc 2015/11/04 11:03:42 No sir, I didn't like it. I prefer augmenting the
kwiberg-webrtc 2015/11/04 14:27:59 Done.
+ return i < NumberOfCodecs() ? rtc::Maybe<int>(static_cast<int>(i))
+ : rtc::Maybe<int>();
}
static inline rtc::Maybe<CodecId> CodecIdFromIndex(int codec_index) {
« 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