Skip to content

Commit ac9a620

Browse files
Storage/VDI.cpp: Fix regression from r174551, the condition to check for a power of two value was inverted (Storage/VDI.cpp: Relatively tight allocation block size sanity check on image creation, quite forgiving check on open to allow even strange values. bugref:11113)
svn:sync-xref-src-repo-rev: r174558
1 parent 671dccd commit ac9a620

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/VBox/Storage/VDI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: VDI.cpp 114715 2026-07-15 18:04:01Z klaus.espenlaub@oracle.com $ */
1+
/* $Id: VDI.cpp 114721 2026-07-17 10:29:34Z alexander.eichner@oracle.com $ */
22
/** @file
33
* Virtual Disk Image (VDI), Core Code.
44
*/
@@ -575,7 +575,7 @@ static int vdiSetupImageState(PVDIIMAGEDESC pImage, unsigned uImageFlags, const
575575

576576
if ( cbAllocationBlock < VDI_IMAGE_DEFAULT_BLOCK_SIZE / 2
577577
|| cbAllocationBlock > VDI_IMAGE_DEFAULT_BLOCK_SIZE * 8
578-
|| !(cbAllocationBlock & (cbAllocationBlock - 1)))
578+
|| !RT_IS_POWER_OF_TWO(cbAllocationBlock))
579579
return vdIfError(pImage->pIfError, VERR_VD_VDI_COMMENT_TOO_LONG, RT_SRC_POS,
580580
N_("VDI: Image with invalid allocation block size in '%s'"), pImage->pszFilename);
581581

0 commit comments

Comments
 (0)