From b07cca0bb59300fe193015f1a8361448af72d05b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 27 Sep 2020 09:46:29 +0200 Subject: Validate json type after parsing --- src/VideoPlayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/VideoPlayer.cpp') diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp index 0ad4152..ac93ecc 100644 --- a/src/VideoPlayer.cpp +++ b/src/VideoPlayer.cpp @@ -254,7 +254,7 @@ namespace QuickMedia { if(buffer[i] != '\n') continue; - if(json_reader->parse(buffer + start, buffer + i, &json_root, &json_errors)) { + if(json_reader->parse(buffer + start, buffer + i, &json_root, &json_errors) && json_root.isObject()) { const Json::Value &event = json_root["event"]; const Json::Value &request_id_json = json_root["request_id"]; if(event.isString()) { -- cgit v1.2.3