summaryrefslogtreecommitdiffstats
path: root/remoting/codec
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-13 02:11:22 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-13 02:11:22 +0000
commit1bd5af9d57d0644f7b24b03f0fb9031e361299f2 (patch)
tree79d071619dff4b4483907f7954920fb6f8dd1649 /remoting/codec
parent5e105337d6f2b7d619b99e2f94b8c822ba136a11 (diff)
downloadchromium_src-1bd5af9d57d0644f7b24b03f0fb9031e361299f2.zip
chromium_src-1bd5af9d57d0644f7b24b03f0fb9031e361299f2.tar.gz
chromium_src-1bd5af9d57d0644f7b24b03f0fb9031e361299f2.tar.bz2
Limit audio buffer size in the audio player used by the chromoting client.
Review URL: https://chromiumcodereview.appspot.com/10914210 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156465 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/codec')
-rw-r--r--remoting/codec/audio_decoder_verbatim.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/remoting/codec/audio_decoder_verbatim.cc b/remoting/codec/audio_decoder_verbatim.cc
index e8143fa..6c9b639 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>();
}