From 756c6388c323d24d39d56ac2e09fbc739302ba0c Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Fri, 7 Aug 2020 15:32:21 +0300
Subject: [PATCH] Fix for bad msgpack decode

---
 web-service/server/src/index.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web-service/server/src/index.js b/web-service/server/src/index.js
index 22eb16270..13b5e01c6 100644
--- a/web-service/server/src/index.js
+++ b/web-service/server/src/index.js
@@ -134,7 +134,7 @@ RGBDStream.prototype.subscribe = function() {
 
 RGBDStream.prototype.pushFrames = function(latency, spacket, packet) {
 	//Checks that the type is jpg
-	if (spacket[3] >= 64) {
+	if (spacket[3] >= 64 && packet[5].length > 0 && packet[0] == 103) {
 		this.data[spacket[3]] = decode(packet[5]);
 	}
 
-- 
GitLab