summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Heron <phil@sanslogic.co.uk>2018-06-27 08:52:46 +0100
committerPhilip Heron <phil@sanslogic.co.uk>2018-06-27 08:52:46 +0100
commit94db83a707e7d834b4bf473a1f055900c0f277fd (patch)
tree920abc175261dc508ad3b8ee5aee9ac2b3daf600
parent5c7dde620c0cd365b257f1f1286872aafcee8078 (diff)
Fix bug where decoder state was not correctly reset on packets with no MCU offset
-rw-r--r--ssdv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ssdv.c b/ssdv.c
index 757a208..ae22297 100644
--- a/ssdv.c
+++ b/ssdv.c
@@ -1337,6 +1337,12 @@ char ssdv_dec_feed(ssdv_t *s, uint8_t *packet)
s->packet_id = packet_id;
}
+ /* Clear the work area if there is no overlap from previous packet */
+ if(s->packet_mcu_offset == 0)
+ {
+ s->workbits = s->worklen = 0;
+ }
+
/* Feed the JPEG data into the processor */
for(; i < s->pkt_size_payload; i++)
{