diff --git a/modules/audio_coding/neteq/tools/fake_decode_from_file.cc b/modules/audio_coding/neteq/tools/fake_decode_from_file.cc index f4376088b8..b0345b08b2 100644 --- a/modules/audio_coding/neteq/tools/fake_decode_from_file.cc +++ b/modules/audio_coding/neteq/tools/fake_decode_from_file.cc @@ -37,8 +37,10 @@ int FakeDecodeFromFile::DecodeInternal(const uint8_t* encoded, ByteReader::ReadLittleEndian(encoded); uint32_t samples_to_decode = ByteReader::ReadLittleEndian(&encoded[4]); - if (samples_to_decode == 0) { - // Number of samples in packet is unknown. + if (samples_to_decode == 0 || + samples_to_decode % rtc::CheckedDivExact(sample_rate_hz, 100) != 0) { + // Number of samples being zero or non-multiple of 10ms is considered + // erroneous. if (last_decoded_length_ > 0) { // Use length of last decoded packet, but since this is the total for all // channels, we have to divide by 2 in the stereo case.