diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index 810442822aa4..94a1b559a8a3 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -1117,6 +1117,8 @@ TextureClient::CreateFromSurface(TextureForwarder* aAllocator, { aAllocator = aAllocator->AsTextureForwarder(); + gfx::BackendType moz2DBackend = BackendTypeForBackendSelector(aLayersBackend, aSelector); + // also test the validity of aAllocator MOZ_ASSERT(aAllocator && aAllocator->IPCOpen()); if (!aAllocator || !aAllocator->IPCOpen()) { @@ -1131,8 +1133,6 @@ TextureClient::CreateFromSurface(TextureForwarder* aAllocator, TextureData* data = nullptr; #if defined(XP_WIN) - gfx::BackendType moz2DBackend = BackendTypeForBackendSelector(aLayersBackend, aSelector); - int32_t maxTextureSize = aAllocator->GetMaxTextureSize(); if (aLayersBackend == LayersBackend::LAYERS_D3D11 &&