Fix a fuzzer-found issue in G.722 decoder

Bug: chromium:1521407
Change-Id: I913108232f195856a9e2693dc1350ec0937fa923
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337182
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Auto-Submit: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41647}
This commit is contained in:
Henrik Lundin 2024-01-31 15:22:13 +00:00 committed by WebRTC LUCI CQ
parent 26ad5b82ce
commit 1d3e286c7f
2 changed files with 7 additions and 0 deletions

View file

@ -63,6 +63,11 @@ int AudioDecoderG722Impl::PacketDuration(const uint8_t* encoded,
return static_cast<int>(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;
}

View file

@ -30,6 +30,8 @@ class AudioDecoderG722Impl final : public AudioDecoder {
std::vector<ParseResult> 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;