From fc9252a4d01b6e9f63566585c7a55bbe23b66de0 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Sat, 11 May 2019 20:01:52 -0400 Subject: [PATCH] image: Fix pitches and offsets in the save image We where first copying the image structure and then setting the pitches and offets, so this information was lost. This fixes vaDerivedImage and vaGetImage implementation. Signed-off-by: Nicolas Dufresne --- src/image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/image.c b/src/image.c index ec2a0c1..fa8b0ea 100644 --- a/src/image.c +++ b/src/image.c @@ -113,13 +113,13 @@ VAStatus RequestCreateImage(VADriverContextP context, VAImageFormat *format, image->num_planes = destination_planes_count; image->data_size = size; - image_object->image = *image; - for (i = 0; i < image->num_planes; i++) { image->pitches[i] = destination_bytesperlines[i]; image->offsets[i] = i > 0 ? destination_sizes[i - 1] : 0; } + image_object->image = *image; + return VA_STATUS_SUCCESS; }