Add owned data buffer to EncodedImage
Bug: webrtc:9378 Change-Id: I6a66b9301cbadf1d6517bf7a96028099970a20a3 Reviewed-on: https://webrtc-review.googlesource.com/c/117964 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Philip Eliasson <philipel@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26585}
This commit is contained in:
@ -259,12 +259,12 @@ int32_t H264DecoderImpl::Decode(const EncodedImage& input_image,
|
||||
// "If the first 23 bits of the additional bytes are not 0, then damaged MPEG
|
||||
// bitstreams could cause overread and segfault." See
|
||||
// AV_INPUT_BUFFER_PADDING_SIZE. We'll zero the entire padding just in case.
|
||||
memset(input_image.data() + input_image.size(), 0,
|
||||
memset(input_image.mutable_data() + input_image.size(), 0,
|
||||
EncodedImage::GetBufferPaddingBytes(kVideoCodecH264));
|
||||
|
||||
AVPacket packet;
|
||||
av_init_packet(&packet);
|
||||
packet.data = input_image.data();
|
||||
packet.data = input_image.mutable_data();
|
||||
if (input_image.size() >
|
||||
static_cast<size_t>(std::numeric_limits<int>::max())) {
|
||||
ReportError();
|
||||
|
Reference in New Issue
Block a user