Index: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc |
diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc |
index e55479551970e60e144e43e1a6e8a18c2087f579..106d14b986e4826434d1b31945da190fdb3d6828 100644 |
--- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc |
+++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc |
@@ -660,6 +660,12 @@ int VP9EncoderImpl::GetEncodedLayerFrame(const vpx_codec_cx_pkt* pkt) { |
int part_idx = 0; |
CodecSpecificInfo codec_specific; |
+ if (pkt->data.frame.sz > encoded_image_._size) { |
+ delete[] encoded_image_._buffer; |
+ encoded_image_._size = pkt->data.frame.sz; |
+ encoded_image_._buffer = new uint8_t[encoded_image_._size]; |
stefan-webrtc
2016/01/20 12:39:07
Don't you have to copy the existing content of the
åsapersson
2016/01/20 13:32:00
It is only copied once right (line 670).
encoded_
stefan-webrtc
2016/01/20 14:11:02
Sure, if you prefer. Although it should as far as
|
+ } |
+ |
assert(pkt->kind == VPX_CODEC_CX_FRAME_PKT); |
memcpy(&encoded_image_._buffer[encoded_image_._length], pkt->data.frame.buf, |
pkt->data.frame.sz); |