[CDFS_NEW] Address review comments:
[reactos.git] / drivers / filesystems / cdfs_new / deviosup.c
index a0bb2b7..517a094 100755 (executable)
@@ -2607,6 +2607,9 @@ Return Value:
             //  Make sure we don't try and read past end of the last track.
             //
 
+#ifdef __REACTOS__
+            if (Vcb->CdromToc) {
+#endif
             TrackData = &Vcb->CdromToc->TrackData[(Vcb->CdromToc->LastTrack - Vcb->CdromToc->FirstTrack + 1)];
 
             SwapCopyUchar4( &EndBlock, &TrackData->Address );
@@ -2617,6 +2620,12 @@ Return Value:
 
                 Blocks = CD_SEC_CHUNK_BLOCKS;
             }
+#ifdef __REACTOS__
+            } else {
+                // HACK!!!!!!!! Might cause reads to overrun the end of the partition, no idea what consequences that can have.
+                Blocks = CD_SEC_CHUNK_BLOCKS;
+            }
+#endif
 
             if ((0 == Blocks) || (Lbn < 16)) {