mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-16 21:58:21 +02:00
virgl:Fix ITEM_CPY macro pointer copy bug
The ITEM_CPY macro uses the memcpy function to copy the item variable. When item is a pointer, the memcpy function will copy the value of the pointer, not the address that the pointer points to. Signed-off-by: Cong Liu <liucong2@kylinos.cn> Reviewerd-by: Feng Jiang <jiangfeng@kylinos.cn> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25453>
This commit is contained in:
parent
6de10c3585
commit
e7d393b1d7
1 changed files with 4 additions and 2 deletions
|
|
@ -549,8 +549,10 @@ static int fill_mpeg4_picture_desc(const struct pipe_picture_desc *desc,
|
|||
ITEM_SET(vmpeg4, mpeg4, rounding_control);
|
||||
ITEM_SET(vmpeg4, mpeg4, alternate_vertical_scan_flag);
|
||||
ITEM_SET(vmpeg4, mpeg4, top_field_first);
|
||||
ITEM_CPY(vmpeg4, mpeg4, intra_matrix);
|
||||
ITEM_CPY(vmpeg4, mpeg4, non_intra_matrix);
|
||||
|
||||
memcpy(vmpeg4->intra_matrix, mpeg4->intra_matrix, 64);
|
||||
memcpy(vmpeg4->non_intra_matrix, mpeg4->non_intra_matrix, 64);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(mpeg4->ref); i++) {
|
||||
vbuf = virgl_video_buffer(mpeg4->ref[i]);
|
||||
vmpeg4->ref[i] = vbuf ? vbuf->handle : 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue