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

Unified Diff: remoting/codec/audio_encoder_verbatim.cc

Issue 10823420: Added more error checking for audio packets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 years, 4 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 | « remoting/codec/audio_decoder_verbatim.cc ('k') | remoting/host/audio_capturer_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/codec/audio_encoder_verbatim.cc
diff --git a/remoting/codec/audio_encoder_verbatim.cc b/remoting/codec/audio_encoder_verbatim.cc
index 52e578a117a39266fd27024d276e15a1218865dd..696035e9f0d60b72632e5e1bec90008195a16c65 100644
--- a/remoting/codec/audio_encoder_verbatim.cc
+++ b/remoting/codec/audio_encoder_verbatim.cc
@@ -17,6 +17,9 @@ scoped_ptr<AudioPacket> AudioEncoderVerbatim::Encode(
scoped_ptr<AudioPacket> packet) {
DCHECK_EQ(AudioPacket::ENCODING_RAW, packet->encoding());
DCHECK_EQ(1, packet->data_size());
+ DCHECK_NE(AudioPacket::SAMPLING_RATE_INVALID, packet->sampling_rate());
+ DCHECK_NE(AudioPacket::BYTES_PER_SAMPLE_INVALID, packet->bytes_per_sample());
+ DCHECK_NE(AudioPacket::CHANNELS_INVALID, packet->channels());
return packet.Pass();
}
« no previous file with comments | « remoting/codec/audio_decoder_verbatim.cc ('k') | remoting/host/audio_capturer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698