From cb885d84ff4ff8373a23d3c2176feaa76511cb97 Mon Sep 17 00:00:00 2001 From: Dejan Jovasevic Date: Tue, 10 Oct 2023 19:34:08 +0200 Subject: [PATCH] VideoRenderer crash on texture update - Pass the 2DRHI texture sizes when updating - It seems like this what is described -> Where the passed ref could have different bounds then the sizes --- DolbyIO/Source/Private/Video/DolbyIOVideoTexture.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DolbyIO/Source/Private/Video/DolbyIOVideoTexture.cpp b/DolbyIO/Source/Private/Video/DolbyIOVideoTexture.cpp index ebb70058..0e6bcd61 100644 --- a/DolbyIO/Source/Private/Video/DolbyIOVideoTexture.cpp +++ b/DolbyIO/Source/Private/Video/DolbyIOVideoTexture.cpp @@ -109,11 +109,11 @@ namespace DolbyIO [SharedThis = AsShared()](FRHICommandListImmediate& RHICmdList) { FScopeLock Lock{SharedThis->GetBufferLock()}; - RHIUpdateTexture2D(SharedThis->Texture->GetResource()->GetTexture2DRHI(), 0, - FUpdateTextureRegion2D{0, 0, 0, 0, - static_cast(SharedThis->Texture->GetSizeX()), - static_cast(SharedThis->Texture->GetSizeY())}, - SharedThis->Texture->GetSizeX() * Stride, SharedThis->GetBuffer()); + auto FRHITexture2D_Ptr = SharedThis->Texture->GetResource()->GetTexture2DRHI(); + uint32 SizeX = FRHITexture2D_Ptr->GetSizeX(), SizeY = FRHITexture2D_Ptr->GetSizeY(); + RHIUpdateTexture2D(FRHITexture2D_Ptr, 0, + FUpdateTextureRegion2D{0, 0, 0, 0, SizeX, SizeY}, + SizeX * Stride, SharedThis->GetBuffer()); }); }