Procházet zdrojové kódy

ImageBackingStore: Fix wrong image size for files not multiple of 512 bytes

CD images in bin/cue format can have sector size that is not divisible by 512.
That's why the real file size must be reported and not rounded to sector boundary.
Only use sector-aligned size for RAW mapping.
Petteri Aimonen před 1 rokem
rodič
revize
93b36fe071
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/ImageBackingStore.cpp

+ 1 - 1
src/ImageBackingStore.cpp

@@ -183,7 +183,7 @@ bool ImageBackingStore::close()
 
 uint64_t ImageBackingStore::size()
 {
-    if (m_iscontiguous && m_blockdev)
+    if (m_iscontiguous && m_blockdev && m_israw)
     {
         return (uint64_t)(m_endsector - m_bgnsector + 1) * SD_SECTOR_SIZE;
     }