From 1d3e286c7f3b8ad7cc492c4914756af59262a39b Mon Sep 17 00:00:00 2001 From: Henrik Lundin Date: Wed, 31 Jan 2024 15:22:13 +0000 Subject: [PATCH] Fix a fuzzer-found issue in G.722 decoder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: chromium:1521407 Change-Id: I913108232f195856a9e2693dc1350ec0937fa923 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337182 Reviewed-by: Jakob Ivarsson‎ Auto-Submit: Henrik Lundin Commit-Queue: Jakob Ivarsson‎ Cr-Commit-Position: refs/heads/main@{#41647} --- modules/audio_coding/codecs/g722/audio_decoder_g722.cc | 5 +++++ modules/audio_coding/codecs/g722/audio_decoder_g722.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/modules/audio_coding/codecs/g722/audio_decoder_g722.cc b/modules/audio_coding/codecs/g722/audio_decoder_g722.cc index e969ed1189..bca47cea13 100644 --- a/modules/audio_coding/codecs/g722/audio_decoder_g722.cc +++ b/modules/audio_coding/codecs/g722/audio_decoder_g722.cc @@ -63,6 +63,11 @@ int AudioDecoderG722Impl::PacketDuration(const uint8_t* encoded, return static_cast(2 * encoded_len / Channels()); } +int AudioDecoderG722Impl::PacketDurationRedundant(const uint8_t* encoded, + size_t encoded_len) const { + return PacketDuration(encoded, encoded_len); +} + int AudioDecoderG722Impl::SampleRateHz() const { return 16000; } diff --git a/modules/audio_coding/codecs/g722/audio_decoder_g722.h b/modules/audio_coding/codecs/g722/audio_decoder_g722.h index 5872fad5de..e7083c3fd6 100644 --- a/modules/audio_coding/codecs/g722/audio_decoder_g722.h +++ b/modules/audio_coding/codecs/g722/audio_decoder_g722.h @@ -30,6 +30,8 @@ class AudioDecoderG722Impl final : public AudioDecoder { std::vector ParsePayload(rtc::Buffer&& payload, uint32_t timestamp) override; int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override; + int PacketDurationRedundant(const uint8_t* encoded, + size_t encoded_len) const override; int SampleRateHz() const override; size_t Channels() const override;