From: suresh guttula <suresh.gutt...@amd.com>

In case of decoding of resolution like 40x24, while allocating surface
video buffer is always aligned with macroblock width/height which is 16. 
But when application tries to get data after decoding through vaCreateImage 
/vaGetImage, image width/height aligned with 2 and result a smaller image
buffer which causes the memory stomping issue.

Signed-off-by: suresh guttula <suresh.gutt...@amd.com>
---
 src/gallium/state_trackers/va/image.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/va/image.c 
b/src/gallium/state_trackers/va/image.c
index 3f892c9..2fc47b7 100644
--- a/src/gallium/state_trackers/va/image.c
+++ b/src/gallium/state_trackers/va/image.c
@@ -123,8 +123,8 @@ vlVaCreateImage(VADriverContextP ctx, VAImageFormat 
*format, int width, int heig
    img->format = *format;
    img->width = width;
    img->height = height;
-   w = align(width, 2);
-   h = align(height, 2);
+   w = align(width, 16);
+   h = align(height, 16);
 
    switch (format->fourcc) {
    case VA_FOURCC('N','V','1','2'):
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to