Fix a fuzzer-found issue in PCM16 decoder

Bug: chromium:1521761
Change-Id: Id5292e80fd6ecae2c39a446dec010b0383bd805e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337200
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41645}
This commit is contained in:
Henrik Lundin 2024-01-31 13:15:00 +00:00 committed by WebRTC LUCI CQ
parent 14b016fbf9
commit 9b7f3649af
2 changed files with 7 additions and 0 deletions

View file

@ -67,4 +67,9 @@ int AudioDecoderPcm16B::PacketDuration(const uint8_t* encoded,
return static_cast<int>(encoded_len / (2 * Channels()));
}
int AudioDecoderPcm16B::PacketDurationRedundant(const uint8_t* encoded,
size_t encoded_len) const {
return PacketDuration(encoded, encoded_len);
}
} // namespace webrtc

View file

@ -32,6 +32,8 @@ class AudioDecoderPcm16B 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;