@@ -246,7 +246,9 @@ private static unsafe void CopyBlock(Block64* b, byte* output)
246246 private static unsafe void Base64DecodeBlockSafe ( byte * outPtr , Block64 * b )
247247 {
248248 Base64Decode ( outPtr , b ->chunk0 ) ;
249- Span < byte > buffer = stackalloc byte [ 32 ] ;
249+ // Should be:
250+ // Span<byte> buffer = stackalloc byte[32];
251+ Span < byte > buffer = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] ;
250252
251253 // Safe memory copy for the last part of the data
252254 fixed ( byte * bufferStart = buffer )
@@ -296,10 +298,12 @@ private static unsafe void Base64DecodeBlock(byte* output, Block64* block)
296298 private static unsafe void Base64DecodeBlockSafe ( byte * outPtr , byte * srcPtr )
297299 {
298300 Base64Decode ( outPtr , Avx2 . LoadVector256 ( srcPtr ) ) ;
299- Base64Decode ( outPtr + 24 , Avx2 . LoadVector256 ( srcPtr + 32 ) ) ;
300- Span < byte > buffer = stackalloc byte [ 32 ] ;
301+ // should be:
302+ // Span<byte> buffer = stackalloc byte[32];
303+ Span < byte > buffer = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] ;
301304 fixed ( byte * bufferPtr = buffer )
302305 {
306+ Base64Decode ( bufferPtr , Avx2 . LoadVector256 ( srcPtr + 32 ) ) ;
303307 // Copy only the first 12 bytes of the decoded fourth block into the output buffer, offset by 36 bytes.
304308 // This step is necessary because the fourth block may not need all 16 bytes if it contains padding characters.
305309 Buffer . MemoryCopy ( bufferPtr , outPtr + 24 , 24 , 24 ) ;
0 commit comments