mirror of
https://github.com/SatDump/SatDump
synced 2026-08-13 17:47:30 -04:00
Fix some Memleaks on 3D!
This commit is contained in:
parent
dba8e2f2a5
commit
9d7c72d972
3 changed files with 8 additions and 8 deletions
|
|
@ -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];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue