UMediaTexture crash when cooking

When running in the editor my UMediaTexture is properly executing InitializeTrack. However when I go to cook, I get the following crash…

UE4Editor-MediaAssets.dll!UMediaTexture::InitializeTrack() Line 252 C++
UE4Editor-CoreUObject.dll!UObject::ConditionalPostLoad() Line 723 C++
UE4Editor-CoreUObject.dll!EndLoad() Line 1285 C++
UE4Editor-CoreUObject.dll!LoadPackageInternal(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags=0, FLinkerLoad * ImportLinker) Line 1041 C++
UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::TickCookOnTheSide(const float TimeSlice=10.0000000, unsigned int & CookedPackageCount=4) Line 1670 C++
UE4Editor-UnrealEd.dll!UCookCommandlet::NewCook(const TArray<ITargetPlatform *,FDefaultAllocator> & Platforms, TArray<FString,FDefaultAllocator> & FilesInPath={…}) Line 1218 C++
UE4Editor-UnrealEd.dll!UCookCommandlet::Main(const FString & CmdLineParams) Line 561 C++
UE4Editor.exe!FEngineLoop::PreInit(const wchar_t * CmdLine=0x0000000002961000) Line 1639 C++
UE4Editor.exe!GuardedMain(const wchar_t * CmdLine=0x00000000005d4538, HINSTANCE__ * hInInstance=0x00000000005d448e, HINSTANCE__ * hPrevInstance=0x000000000000000a, int nCmdShow=1069809664) Line 110 C++
UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance=0x000000013fc40000, HINSTANCE__ * hPrevInstance=0x0000000000000000, char * __formal=0x0000000000000000, int nCmdShow=10) Line 189 C++
UE4Editor.exe!__tmainCRTStartup() Line 618 C
kernel32.dll!0000000076d45a4d() Unknown
ntdll.dll!0000000076e7b831() Unknown

Specifically at…

	VideoTrackPtr->AddBoundTexture((Resource->TextureRHI.GetReference()));

… because Resource is null. The previous call to UpdateResource is not initializing Resource because UTexture::UpdateResource is checking against FApp::CanEverRender which is returning false during the cook process.

How do I resolve?

Thanks,

Hey JasonKing,

In order to better assist you, could you please upload your full error and provide the exact reproduction steps you took to get this error? Is this happening on the Editor from our Epic Games Launcher or from GitHub?

Looking forwarding to hearing back from you, thanks!

Hi ,

Thanks for your response. This is happening with my GitHub build. We are specifically using 4.9.0. My previous callstack came from a DebugGameEditor build that I debugged using the commandline cook arguments. The attached the [log][1] is from packaging from with the UnrealEditor using DevelopmentEditor build.

60271-nu_reality.log (600 KB)

Hey ,

Sorry for the delay. This problem was fixed as part of [Github commit][1]

https://github.com/EpicGames/UnrealEngine/commit/70bdbe0758c46e582c8f09da795c55c6bbf71484

And some subsequent cosmetic changes here: [Github commit][1]

https://github.com/EpicGames/UnrealEngine/commit/71ae85b026f78bf6908f5f955106bf35a48528c1