diff --git a/DirectXTex/DirectXTexMipmaps.cpp b/DirectXTex/DirectXTexMipmaps.cpp index 2959d77..382ee1a 100644 --- a/DirectXTex/DirectXTexMipmaps.cpp +++ b/DirectXTex/DirectXTexMipmaps.cpp @@ -611,9 +611,6 @@ static HRESULT _Generate2DMipsPointFilter( _In_ size_t levels, _In_ const Scratc size_t width = mipChain.GetMetadata().width; size_t height = mipChain.GetMetadata().height; - if ( !ispow2(width) || !ispow2(height) ) - return E_FAIL; - // Allocate temporary space (2 scanlines) ScopedAlignedArrayXMVECTOR scanline( reinterpret_cast( _aligned_malloc( (sizeof(XMVECTOR)*width*2), 16 ) ) ); if ( !scanline ) @@ -698,6 +695,9 @@ static HRESULT _Generate2DMipsBoxFilter( _In_ size_t levels, _In_ const ScratchI size_t width = mipChain.GetMetadata().width; size_t height = mipChain.GetMetadata().height; + if ( !ispow2(width) || !ispow2(height) ) + return E_FAIL; + // Allocate temporary space (3 scanlines) ScopedAlignedArrayXMVECTOR scanline( reinterpret_cast( _aligned_malloc( (sizeof(XMVECTOR)*width*3), 16 ) ) ); if ( !scanline )