Skip to content

Commit

Permalink
[#80] Support for HxC Floppy Emulator *.HFE images (Part 17: Fixed me…
Browse files Browse the repository at this point in the history
…mory leakage)
  • Loading branch information
tomas-nestorovic committed Jan 9, 2025
1 parent dea6ffe commit 68e517f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Main/src/HFE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,11 @@ formatError: ::SetLastError(ERROR_BAD_FORMAT);
// - construction of InternalTracks for both Heads
if (!cylInfos[cyl].IsValid()) // maybe an error during Image creation?
return CTrackReaderWriter::Invalid;
internalTracks[cyl][0]=BytesToTrack( ReadTrackBytes(cyl,0) );
if (!params.flippyDisk) // flippy disks not known to be represented backwards in *.HFE, hence always fail if this flag is set
internalTracks[cyl][1]=BytesToTrack( ReadTrackBytes(cyl,1) );
if (!internalTracks[cyl][0])
internalTracks[cyl][0]=BytesToTrack( ReadTrackBytes(cyl,0) );
if (!internalTracks[cyl][1])
if (!params.flippyDisk) // flippy disks not known to be represented backwards in *.HFE, hence always fail if this flag is set
internalTracks[cyl][1]=BytesToTrack( ReadTrackBytes(cyl,1) );
const PInternalTrack &rit=internalTracks[cyl][head];
return rit ? *rit : CTrackReaderWriter::Invalid;
}
Expand Down

0 comments on commit 68e517f

Please sign in to comment.