d3d12: fix incorrect memset in d3d12_video_encoder_references_manager_hevc

Fixes: 92d6989fdc ("d3d12: Add support for HEVC 4:4:4 video encode using AYUV format")

Signed-Off-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31371>
This commit is contained in:
Pohsiang (John) Hsu 2024-09-25 11:16:21 -07:00 committed by Marge Bot
parent a8eed9cca2
commit e0d77f925e

View file

@ -37,7 +37,7 @@ d3d12_video_encoder_references_manager_hevc::get_current_frame_picture_control_d
assert((codecAllocation.DataSize == sizeof(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC)) ||
(codecAllocation.DataSize == sizeof(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC1)));
memcpy(codecAllocation.pHEVCPicData1, &m_curFrameState, codecAllocation.DataSize);
memset(codecAllocation.pHEVCPicData1 + codecAllocation.DataSize, 0, sizeof(m_curFrameState) - codecAllocation.DataSize);
memset((uint8_t *)(& codecAllocation.pHEVCPicData1) + codecAllocation.DataSize, 0, sizeof(m_curFrameState) - codecAllocation.DataSize);
return true;
}
@ -254,7 +254,7 @@ d3d12_video_encoder_references_manager_hevc::begin_frame(D3D12_VIDEO_ENCODER_PIC
assert((curFrameData.DataSize == sizeof(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC)) ||
(curFrameData.DataSize == sizeof(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC1)));
memcpy(&m_curFrameState, curFrameData.pHEVCPicData1, curFrameData.DataSize);
memset(&m_curFrameState + curFrameData.DataSize, 0, sizeof(m_curFrameState) - curFrameData.DataSize);
memset(((uint8_t*)(&m_curFrameState) + curFrameData.DataSize), 0, sizeof(m_curFrameState) - curFrameData.DataSize);
m_isCurrentFrameUsedAsReference = bUsedAsReference;