diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-04 23:42:27 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-04 23:42:27 +0000 |
commit | 7654e5676badbedb44d8fae6ff7fa6c62b466b50 (patch) | |
tree | e73cc07fd21d2a0d471bd6f6d8cce158de921a9a | |
parent | 6ed24eadff6acae446249810b95da8ca5eaeff17 (diff) | |
download | chromium_src-7654e5676badbedb44d8fae6ff7fa6c62b466b50.zip chromium_src-7654e5676badbedb44d8fae6ff7fa6c62b466b50.tar.gz chromium_src-7654e5676badbedb44d8fae6ff7fa6c62b466b50.tar.bz2 |
Merge 48471 - pad yuv additional 15 bytes to allow 16 pixels at a time to be processed without going off end of buffer.
BUG=43970
TEST=play http://fbarchard0-w.ad.corp.google.com/mediatests/Etherworks-WebMadeMovies3BuildingABetterInternet799.ogg with scaling down (CTRL -). Should not crash.
Review URL: http://codereview.chromium.org/2337001
TBR=fbarchard@chromium.org
Review URL: http://codereview.chromium.org/2668004
git-svn-id: svn://svn.chromium.org/chrome/branches/375/src@48989 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | media/base/video_frame.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc index 0b8239c..fcb8cdb 100644 --- a/media/base/video_frame.cc +++ b/media/base/video_frame.cc @@ -109,6 +109,8 @@ bool VideoFrame::AllocateRGB(size_t bytes_per_pixel) { return (NULL != data_[VideoFrame::kRGBPlane]); } +static const int kFramePadBytes = 15; // allows faster SIMD YUV convert + bool VideoFrame::AllocateYUV() { DCHECK(format_ == VideoFrame::YV12 || format_ == VideoFrame::YV16); @@ -129,7 +131,7 @@ bool VideoFrame::AllocateYUV() { if (format_ == VideoFrame::YV12) { uv_bytes /= 2; } - uint8* data = new uint8[y_bytes + (uv_bytes * 2)]; + uint8* data = new uint8[y_bytes + (uv_bytes * 2) + kFramePadBytes]; if (data) { planes_ = VideoFrame::kNumYUVPlanes; COMPILE_ASSERT(0 == VideoFrame::kYPlane, y_plane_data_must_be_index_0); |