Fix some Memleaks on 3D!

This commit is contained in:
Aang23 2022-06-06 21:00:44 +02:00
parent dba8e2f2a5
commit 9d7c72d972
3 changed files with 8 additions and 8 deletions

View file

@ -36,7 +36,7 @@ namespace fengyun3
currentTime = lastTime;
int pos = 50;
for (int i = 0; i < 500; i++)
for (int i = 0; i < 500 - 32; i++)
{
lineBuf[i] = packet.payload[pos + i * 2 + 0] << 8 | packet.payload[pos + i * 2 + 1];
}

View file

@ -37,7 +37,7 @@ namespace fengyun3
int pos = 38;
int bitpos = 0;
for (int i = 0; i < 1000; i++)
for (int i = 0; i < 500 - 8; i++)
{
uint8_t bitShiftBuffer[2];
bitShiftBuffer[0] = packet.payload[pos + i * 2 + 0] << bitpos | packet.payload[pos + i * 2 + 1] >> (8 - bitpos);
@ -50,9 +50,9 @@ namespace fengyun3
{
for (int ch = 0; ch < 16; ch++)
{
//if (marker == 1)
// imageData[currentTime][ch][i] = lineBuf[i * 16 + ch]; // Packet 1 seems to only contain some calibration or so
// Maybe I am discarding some data there but I could not find any matching pixels to the rest of the data
// if (marker == 1)
// imageData[currentTime][ch][i] = lineBuf[i * 16 + ch]; // Packet 1 seems to only contain some calibration or so
// Maybe I am discarding some data there but I could not find any matching pixels to the rest of the data
if (marker == 2)
imageData[currentTime][ch][i + 30 * 0] = lineBuf[i * 16 + ch];
else if (marker == 3)

View file

@ -30,7 +30,7 @@ namespace fengyun3
if (marker == 2)
{
if (lines < 832 * 832)
if (lines + 3603 < 832 * 832)
for (int i = 0; i < 3603; i++)
image[lines + i] = packet[68 + i * 2 + 0] << 8 | packet[68 + i * 2 + 1];
lines += 3603;
@ -41,14 +41,14 @@ namespace fengyun3
if (lines > 0)
writeCurrent();
if (lines < 832 * 832)
if (lines + 32591 < 832 * 832)
for (int i = 0; i < 32591; i++)
image[lines + i] = packet[320 + i * 2 + 0] << 8 | packet[320 + i * 2 + 1];
lines += 32591;
}
else
{
if (lines < 832 * 832)
if (lines + 32737 < 832 * 832)
for (int i = 0; i < 32737; i++)
image[lines + i] = packet[68 + i * 2 + 0] << 8 | packet[68 + i * 2 + 1];
lines += 32737;