Chromium Code Reviews

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: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
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();
}

Powered by Google App Engine