Commit 77dd30fe authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media/gpu/vaapiDmabufVFMapper: Fix out of bounds access

This fixes the access out of bounds in VaapiDmabufVideoFrameMapper.
The class creates VideoFrames by VideoFrame::WrapExternalYuvDataWithLayout().
It needs three plane's addresses. However, the class creates
an array whose size is two. It causes the issue when accessing the
third element in the array.

Bug: 1020776
Test: VDA tests resolution_change_500frames.vp9.ivf  one hour w/o --use_vd
Change-Id: I50910e564076916193f0e1b366f8ec165945c71d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2060226Reviewed-by: default avatarDavid Staessens <dstaessens@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742062}
parent 028d72bf
...@@ -47,7 +47,7 @@ scoped_refptr<VideoFrame> CreateMappedVideoFrame( ...@@ -47,7 +47,7 @@ scoped_refptr<VideoFrame> CreateMappedVideoFrame(
// All the planes are stored in the same buffer, VAImage.va_buffer. // All the planes are stored in the same buffer, VAImage.va_buffer.
std::vector<ColorPlaneLayout> planes(num_planes); std::vector<ColorPlaneLayout> planes(num_planes);
std::vector<uint8_t*> addrs(num_planes, nullptr); uint8_t* addrs[VideoFrame::kMaxPlanes] = {};
for (size_t i = 0; i < num_planes; i++) { for (size_t i = 0; i < num_planes; i++) {
planes[i].stride = va_image->image()->pitches[i]; planes[i].stride = va_image->image()->pitches[i];
planes[i].offset = va_image->image()->offsets[i]; planes[i].offset = va_image->image()->offsets[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment