diff --git a/plugins/fengyun3_support/fengyun3/instruments/mwhs2/mwhs2_reader.cpp b/plugins/fengyun3_support/fengyun3/instruments/mwhs2/mwhs2_reader.cpp index 11db19b6e..cfe1c54d8 100644 --- a/plugins/fengyun3_support/fengyun3/instruments/mwhs2/mwhs2_reader.cpp +++ b/plugins/fengyun3_support/fengyun3/instruments/mwhs2/mwhs2_reader.cpp @@ -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]; } diff --git a/plugins/fengyun3_support/fengyun3/instruments/mwts2/mwts2_reader.cpp b/plugins/fengyun3_support/fengyun3/instruments/mwts2/mwts2_reader.cpp index 09a5a6056..da3cb9e00 100644 --- a/plugins/fengyun3_support/fengyun3/instruments/mwts2/mwts2_reader.cpp +++ b/plugins/fengyun3_support/fengyun3/instruments/mwts2/mwts2_reader.cpp @@ -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) diff --git a/plugins/fengyun3_support/fengyun3/instruments/wai/wai_reader.cpp b/plugins/fengyun3_support/fengyun3/instruments/wai/wai_reader.cpp index f693b9a23..d0128ef9f 100644 --- a/plugins/fengyun3_support/fengyun3/instruments/wai/wai_reader.cpp +++ b/plugins/fengyun3_support/fengyun3/instruments/wai/wai_reader.cpp @@ -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;