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

Unified Diff: remoting/codec/audio_decoder_verbatim.cc

Issue 10914210: Limit audio buffer size in the audio player used by the chromoting client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 e8143fa512da79e96f2939803d15d64aedd59d33..6c9b6394c18adb2d937b6fa1425452a8a1c728fc 100644
--- a/remoting/codec/audio_decoder_verbatim.cc
+++ b/remoting/codec/audio_decoder_verbatim.cc
@@ -22,7 +22,9 @@ scoped_ptr<AudioPacket> AudioDecoderVerbatim::Decode(
(packet->data_size() != 1) ||
(packet->sampling_rate() == AudioPacket::SAMPLING_RATE_INVALID) ||
(packet->bytes_per_sample() != AudioPacket::BYTES_PER_SAMPLE_2) ||
- (packet->channels() != AudioPacket::CHANNELS_STEREO)) {
+ (packet->channels() != AudioPacket::CHANNELS_STEREO) ||
+ (packet->data(0).size() %
+ (AudioPacket::CHANNELS_STEREO * AudioPacket::BYTES_PER_SAMPLE_2) != 0)) {
LOG(WARNING) << "Verbatim decoder received an invalid packet.";
return scoped_ptr<AudioPacket>();
}

Powered by Google App Engine
This is Rietveld 408576698