diff --git a/.pick_status.json b/.pick_status.json index 81f97c11601..e19f64c5d6e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1453,7 +1453,7 @@ "description": "frontends/va: Ignore requested size when creating VAEncCodedBufferType", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/frontends/va/buffer.c b/src/gallium/frontends/va/buffer.c index 6a8ca44534c..908b6bd21e2 100644 --- a/src/gallium/frontends/va/buffer.c +++ b/src/gallium/frontends/va/buffer.c @@ -57,7 +57,11 @@ vlVaCreateBuffer(VADriverContextP ctx, VAContextID context, VABufferType type, buf->type = type; buf->size = size; buf->num_elements = num_elements; - buf->data = MALLOC(size * num_elements); + + if (buf->type == VAEncCodedBufferType) + buf->data = CALLOC(1, sizeof(VACodedBufferSegment)); + else + buf->data = MALLOC(size * num_elements); if (!buf->data) { FREE(buf); @@ -161,7 +165,6 @@ vlVaMapBuffer(VADriverContextP ctx, VABufferID buf_id, void **pbuff) if (buf->type == VAEncCodedBufferType) { ((VACodedBufferSegment*)buf->data)->buf = *pbuff; ((VACodedBufferSegment*)buf->data)->size = buf->coded_size; - ((VACodedBufferSegment*)buf->data)->next = NULL; *pbuff = buf->data; } } else {