From 7fdc061934cb275db988e6082797ba415e7a1002 Mon Sep 17 00:00:00 2001 From: Dejan Jovasevic Date: Wed, 11 Oct 2023 11:16:18 +0200 Subject: [PATCH] VideoRenderer crash on texture update (#421) - 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..219627a5 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()); }); }