Delete EncodedImage::GetBufferPaddingBytes
For the ffmpeg H.264 decoder, rely on ffmpeg being configured with CONFIG_SAFE_BITSTREAM_READER. Bug: webrtc:9378 Change-Id: Ia7a46580d520808e36581252a95feeb5f9c57bf9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/119665 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27124}
This commit is contained in:
@ -167,14 +167,8 @@ absl::optional<FrameMarking> RtpFrameObject::GetFrameMarking() const {
|
||||
}
|
||||
|
||||
void RtpFrameObject::AllocateBitstreamBuffer(size_t frame_size) {
|
||||
// Since FFmpeg use an optimized bitstream reader that reads in chunks of
|
||||
// 32/64 bits we have to add at least that much padding to the buffer
|
||||
// to make sure the decoder doesn't read out of bounds.
|
||||
size_t new_size = frame_size + (codec_type_ == kVideoCodecH264
|
||||
? EncodedImage::kBufferPaddingBytesH264
|
||||
: 0);
|
||||
if (capacity() < new_size) {
|
||||
Allocate(new_size);
|
||||
if (capacity() < frame_size) {
|
||||
Allocate(frame_size);
|
||||
}
|
||||
|
||||
set_size(frame_size);
|
||||
|
||||
Reference in New Issue
Block a user