Skip to content

Commit 37a3b97

Browse files
Fixed Additional Bug Causing File to Cut Off
-Fixed a second bug within YAY0 and YAZ0 to cut off in certain conditions. An improvement upon the previous fix.
1 parent 5f5a7fd commit 37a3b97

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

PeepsCompress/PeepsCompress/Algorithm Classes/YAY0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public byte[] buildYAY0CompressedBlock(ref List<byte> layoutBits, ref List<byte>
173173
{
174174
BitArray arrayOfBits = new BitArray(new byte[1] { layoutBytes[i] });
175175

176-
for (int j = 7; ((j > -1) && (uncompressedData.Count > 0) && (compressedDataBytes.Count > 0)) ; j--)
176+
for (int j = 7; ((j > -1) && ((uncompressedData.Count > 0) || (compressedDataBytes.Count > 0))) ; j--)
177177
{
178178
if (arrayOfBits[j] == true)
179179
{

PeepsCompress/PeepsCompress/Algorithm Classes/YAZ0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public byte[] buildYAZ0CompressedBlock(ref List<byte> layoutBits, ref List<byte>
143143

144144
BitArray arrayOfBits = new BitArray(new byte[1] { layoutBytes[i] });
145145

146-
for (int j = 7; ((j > -1) && (uncompressedData.Count > 0) && (compressedDataBytes.Count > 0)); j--)
146+
for (int j = 7; ((j > -1) && ((uncompressedData.Count > 0) || (compressedDataBytes.Count > 0))); j--)
147147
{
148148
if(arrayOfBits[j] == true)
149149
{

0 commit comments

Comments
 (0)