summaryrefslogtreecommitdiffstats
path: root/remoting/codec/audio_decoder_verbatim.cc
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/codec/audio_decoder_verbatim.cc')
-rw-r--r--remoting/codec/audio_decoder_verbatim.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/remoting/codec/audio_decoder_verbatim.cc b/remoting/codec/audio_decoder_verbatim.cc
index 8a69705..903cb3f 100644
--- a/remoting/codec/audio_decoder_verbatim.cc
+++ b/remoting/codec/audio_decoder_verbatim.cc
@@ -17,7 +17,13 @@ AudioDecoderVerbatim::~AudioDecoderVerbatim() {
scoped_ptr<AudioPacket> AudioDecoderVerbatim::Decode(
scoped_ptr<AudioPacket> packet) {
- DCHECK_EQ(AudioPacket::ENCODING_RAW, packet->encoding());
+ // Return a null scoped_ptr if we get a corrupted packet.
+ 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)) {
+ return scoped_ptr<AudioPacket>();
+ }
return packet.Pass();
}