summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>2021-03-12 09:19:57 +0100
committerDylan Baker <dylan.c.baker@intel.com>2021-03-15 11:37:35 -0700
commitafafb94bc6af173def3618d1e90f6f75076b5cce (patch)
treed56091be262c4dc9e1e795f8660e7b535501cf64
parentdf545c771e99ddfad96ec8bfca16224a321b6932 (diff)
frontends/va: fix protected slice data buffer read size
Read vlVaBuffer->size bytes instead of an hardcoded value. Fixes: deb7dc82f62 ("frontends/va: handle protected slice data buffer") Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> Reviewed-by: James Zhu <James.Zhu@amd.com> Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9553> (cherry picked from commit 9e5623ccc39fe4b4d04421baa87fa01798a10353)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/frontends/va/picture.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index eca03725d65..25d64831bf4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -211,7 +211,7 @@
"description": "frontends/va: fix protected slice data buffer read size",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "deb7dc82f626e92525d01829d88f0ac348de03b8"
},
diff --git a/src/gallium/frontends/va/picture.c b/src/gallium/frontends/va/picture.c
index bcfb79e75f2..0b65e2687a2 100644
--- a/src/gallium/frontends/va/picture.c
+++ b/src/gallium/frontends/va/picture.c
@@ -263,7 +263,7 @@ handleVAProtectedSliceDataBufferType(vlVaContext *context, vlVaBuffer *buf)
{
uint8_t* encrypted_data = (uint8_t*) buf->data;
- unsigned int drm_key_size = 56 * 4;
+ unsigned int drm_key_size = buf->size;
context->desc.base.decrypt_key = CALLOC(1, drm_key_size);
memcpy(context->desc.base.decrypt_key, encrypted_data, drm_key_size);