Module: Mesa
Branch: master
Commit: 9e5623ccc39fe4b4d04421baa87fa01798a10353
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e5623ccc39fe4b4d04421baa87fa01798a10353

Author: Pierre-Eric Pelloux-Prayer <[email protected]>
Date:   Fri Mar 12 09:19:57 2021 +0100

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 <[email protected]>
Reviewed-by: James Zhu <[email protected]>
Reviewed-by: Boyuan Zhang <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9553>

---

 src/gallium/frontends/va/picture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/frontends/va/picture.c 
b/src/gallium/frontends/va/picture.c
index 39ac664905e..32d8b925036 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);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to