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

Unified Diff: remoting/codec/audio_decoder_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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/codec/audio_decoder_verbatim.cc
diff --git a/remoting/codec/audio_decoder_verbatim.cc b/remoting/codec/audio_decoder_verbatim.cc
index 903cb3f298b824a34928ac795c8566521321f9fa..43919c6c99f1f95cf375d3ddc0bbbb9651cd5dbf 100644
--- a/remoting/codec/audio_decoder_verbatim.cc
+++ b/remoting/codec/audio_decoder_verbatim.cc
@@ -21,7 +21,8 @@ scoped_ptr<AudioPacket> AudioDecoderVerbatim::Decode(
if ((packet->encoding() != AudioPacket::ENCODING_RAW) ||
(packet->data_size() != 1) ||
(packet->sampling_rate() == AudioPacket::SAMPLING_RATE_INVALID) ||
- (packet->bytes_per_sample() == AudioPacket::BYTES_PER_SAMPLE_INVALID)) {
+ (packet->bytes_per_sample() == AudioPacket::BYTES_PER_SAMPLE_INVALID) ||
Sergey Ulanov 2012/08/20 22:26:20 here you want to check that bytes_per_sample() ==
kxing 2012/08/20 22:48:22 Done.
+ (packet->channels() == AudioPacket::CHANNELS_INVALID)) {
Sergey Ulanov 2012/08/20 22:26:20 check that we have two channels, not only that the
kxing 2012/08/20 22:48:22 Done.
return scoped_ptr<AudioPacket>();
}
return packet.Pass();

Powered by Google App Engine
This is Rietveld 408576698