From 2f887323a066a7139762bfc8cc258f999ac936f3 Mon Sep 17 00:00:00 2001 From: "hlundin@google.com" Date: Tue, 21 Jun 2011 14:33:28 +0000 Subject: [PATCH] Bugfix in VP8 wrapper Decode method Failed to preserve the size parameter in the keyframe storage. Review URL: http://webrtc-codereview.appspot.com/48003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@113 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/video_coding/codecs/vp8/main/source/vp8.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/video_coding/codecs/vp8/main/source/vp8.cc b/modules/video_coding/codecs/vp8/main/source/vp8.cc index 364fc36b94..dcf10d135a 100644 --- a/modules/video_coding/codecs/vp8/main/source/vp8.cc +++ b/modules/video_coding/codecs/vp8/main/source/vp8.cc @@ -778,9 +778,10 @@ VP8Decoder::Decode(const EncodedImage& inputImage, } WebRtc_UWord8* tempBuffer = _lastKeyFrame._buffer; // Save buffer ptr. + WebRtc_UWord32 tempSize = _lastKeyFrame._size; // Save size. _lastKeyFrame = inputImage; // Shallow copy. _lastKeyFrame._buffer = tempBuffer; // Restore buffer ptr. - _lastKeyFrame._length = bytesToCopy; + _lastKeyFrame._size = tempSize; // Restore buffer size. if (!_lastKeyFrame._buffer) { // Allocate memory. @@ -789,7 +790,8 @@ VP8Decoder::Decode(const EncodedImage& inputImage, } // Copy encoded frame. memcpy(_lastKeyFrame._buffer, inputImage._buffer + numberOfBytes, - _lastKeyFrame._length); + bytesToCopy); + _lastKeyFrame._length = bytesToCopy; } int lastRefUpdates = 0;