[Android] Fix video codec specific data corruption
commit89445eabf66316dc372191f43b67bfa7874e3612
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 18 Sep 2013 09:25:17 +0000 (18 09:25 +0000)
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 18 Sep 2013 09:25:17 +0000 (18 09:25 +0000)
tree3fdbdc8f8f426313445e39be8b2d3358f8815df1
parent4e347a4e8962f589db74b4368e0015863dd6c6bb
[Android] Fix video codec specific data corruption

NewDirectByteBuffer does not copy the provided data but assumes the data
is available for the life time of the Java ByteBuffer object. This mean
passing in a stack allocated byte buffer will lead to memory corruption
when the buffer goes out of scope.

Fix by copying the data into a separate java byte buffer.

BUG=293874

Review URL: https://chromiumcodereview.appspot.com/24045004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223828 0039d316-1c4b-4281-b951-d872f2087c98
media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
media/base/android/media_codec_bridge.cc